Skip to content

Conversation

@edwingustafson
Copy link
Contributor

No description provided.

@edwingustafson edwingustafson changed the title Missed another case of returning a trivial local variable Consolidate percentile(); remove unused percentRank(); return result directly without trivial local variablre Nov 15, 2018
@edwingustafson edwingustafson changed the title Consolidate percentile(); remove unused percentRank(); return result directly without trivial local variablre Consolidate percentile(); remove unused percentRank(); return result directly without trivial local variable Nov 15, 2018
@edwingustafson edwingustafson changed the title Consolidate percentile(); remove unused percentRank(); return result directly without trivial local variable Consolidate duplicated percentile(); remove unused percentRank(); return result directly without trivial local variable Nov 15, 2018
@@ -1,3 +1,5 @@
const percentile = require('../percentile')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this the first instance of const in this code? We've generally avoided it so far (in favor of var) because some people are still using old versions of node that barf on const.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Happy to follow that policy, this pull request now imports percentile with var not const.

(I did find one other module using const though.
https://github.com/openaps/oref0/blob/master/lib/iob/calculate.js#L38 )

@scottleibrand scottleibrand merged commit 0fb6109 into openaps:dev Nov 18, 2018
ivalkou pushed a commit to ivalkou/oref0 that referenced this pull request Nov 27, 2018
…urn result directly without trivial local variable (openaps#1144)

* Use endsWith from Lodash

* Return function results directly (without trivial local variable)

* Eliminate another case of function returning trivial local variable

* Another opportunity to directly return function result without a trivial local variable

* Consolidate redundant functions "percentile"; remove unused function "percentRank"

* Import percentile with var not const
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants