Procházet zdrojové kódy

remove unnecessary returns

Brian Gough před 5 roky
rodič
revize
299d7cc5fe
1 změnil soubory, kde provedl 5 přidání a 6 odebrání
  1. 5 6
      services/clsi/app/js/ResourceStateManager.js

+ 5 - 6
services/clsi/app/js/ResourceStateManager.js

@@ -6,7 +6,6 @@
 // Fix any style issues and re-enable lint.
 // Fix any style issues and re-enable lint.
 /*
 /*
  * decaffeinate suggestions:
  * decaffeinate suggestions:
- * DS102: Remove unnecessary code created because of implicit returns
  * DS201: Simplify complex destructure assignments
  * DS201: Simplify complex destructure assignments
  * DS207: Consider shorter variations of null checks
  * DS207: Consider shorter variations of null checks
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
  * Full docs: https://github.com/decaffeinate/decaffeinate/blob/master/docs/suggestions.md
@@ -45,7 +44,7 @@ module.exports = ResourceStateManager = {
     if (state == null) {
     if (state == null) {
       // remove the file if no state passed in
       // remove the file if no state passed in
       logger.log({ state, basePath }, 'clearing sync state')
       logger.log({ state, basePath }, 'clearing sync state')
-      return fs.unlink(stateFile, function (err) {
+      fs.unlink(stateFile, function (err) {
         if (err != null && err.code !== 'ENOENT') {
         if (err != null && err.code !== 'ENOENT') {
           return callback(err)
           return callback(err)
         } else {
         } else {
@@ -55,7 +54,7 @@ module.exports = ResourceStateManager = {
     } else {
     } else {
       logger.log({ state, basePath }, 'writing sync state')
       logger.log({ state, basePath }, 'writing sync state')
       const resourceList = resources.map((resource) => resource.path)
       const resourceList = resources.map((resource) => resource.path)
-      return fs.writeFile(
+      fs.writeFile(
         stateFile,
         stateFile,
         [...resourceList, `stateHash:${state}`].join('\n'),
         [...resourceList, `stateHash:${state}`].join('\n'),
         callback
         callback
@@ -69,7 +68,7 @@ module.exports = ResourceStateManager = {
     }
     }
     const stateFile = Path.join(basePath, this.SYNC_STATE_FILE)
     const stateFile = Path.join(basePath, this.SYNC_STATE_FILE)
     const size = this.SYNC_STATE_MAX_SIZE
     const size = this.SYNC_STATE_MAX_SIZE
-    return SafeReader.readFile(stateFile, size, 'utf8', function (
+    SafeReader.readFile(stateFile, size, 'utf8', function (
       err,
       err,
       result,
       result,
       bytesRead
       bytesRead
@@ -98,7 +97,7 @@ module.exports = ResourceStateManager = {
         )
         )
       } else {
       } else {
         const resources = resourceList.map((path) => ({ path }))
         const resources = resourceList.map((path) => ({ path }))
-        return callback(null, resources)
+        callback(null, resources)
       }
       }
     })
     })
   },
   },
@@ -136,7 +135,7 @@ module.exports = ResourceStateManager = {
         )
         )
       )
       )
     } else {
     } else {
-      return callback()
+      callback()
     }
     }
   },
   },
 }
 }