flag some duplicated code

pull/1/head
ansuz 4 years ago
parent c8a3a0bd16
commit f7bada95ed

@ -273,7 +273,7 @@ define([
return $div;
};
var getPrettySize = function (bytes) {
var getPrettySize = function (bytes) { // XXX duplicate of UIElements.prettySize ?
var unit = Util.magnitudeOfBytes(bytes);
var value = unit === 'GB' ? Util.bytesToGigabytes(bytes) : Util.bytesToMegabytes(bytes);
return unit === 'GB' ? Messages._getKey('formattedGB', [value])

@ -35,9 +35,9 @@ define([
UIElements.prettySize = function (bytes) {
var kB = Util.bytesToKilobytes(bytes);
if (kB < 1024) { return kB + Messages.KB; }
if (kB < 1024) { return kB + Messages.KB; } // XXX replace with Msg.formattedKB ?
var mB = Util.bytesToMegabytes(bytes);
return mB + Messages.MB;
return mB + Messages.MB; // XXX replace with Msg.formattedMB
};
UIElements.updateTags = function (common, hrefs) {

@ -272,7 +272,7 @@
else if (bytes >= oneMegabyte) { return 'MB'; }
};
Util.getPrettySize = function (bytes, Messages) {
Util.getPrettySize = function (bytes, Messages) { // XXX not used anywhere?
var unit = Util.magnitudeOfBytes(bytes);
if (unit === 'GB') {
return Messages._getKey('formattedGB', [Util.bytesToGigabytes(bytes)]);

Loading…
Cancel
Save