simplify boolean assignment #466

Merged
merged 1 commit into from Mar 7, 2015
Jump to file
+1 −9
Split
View
@@ -21,17 +21,9 @@ function directionToTrend (direction) {
function pebble (req, res) {
var ONE_DAY = 24 * 60 * 60 * 1000;
+ var useMetricBg = (req.query.units === "mmol");
var uploaderBattery;
- function requestMetric() {
- var units = req.query.units;
- if (units == "mmol") {
- return true;
- }
- return false;
- }
- var useMetricBg = requestMetric();
-
function scaleBg(bg) {
if (useMetricBg) {
return (Math.round((bg / 18) * 10) / 10).toFixed(1);