You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* fix(file-size): use exact multipliers for MiB, GiB, etc.
* refactor(file-size): use table for byte->MiB conversion instead of ifs
Shrink the code size a bit by using a table instead of repeating code.
* fix(file-size): fix special case for Megabyte and first row
For some reason, the removeUnitTypeConvertToBytes code was special cased for the
first row. This forced a workaround for the Megabyte case. Fix
removeUnitTypeConvertToBytes to not special case i==0 and remove the need for
the Megabyte workarond.
* refactor(file-size): inline helper table
Shrink code size by inlining the 'fileSizes' helper table.
* refactor(file-size): simplify: s.replace(s, r) -> r
* refactor(file-size): simplify some regular expressions
* refactor(file-size): extract number and unit from table cell once, not twice
* refactor(file-size): simplify unit matching regexps
* refactor(file-size): use simple string comparisons for unit matching
* refactor(file-size): simplify removeUnitTypeConvertToBytes
* refactor(file-size): use lookup table for unit-to-multiplier conversion
* refactor(file-size): inline function
0 commit comments