]> git.wincent.com - hextrapolate.git/commitdiff
refactor: put things back the way they were
authorGreg Hurrell <greg@hurrell.net>
Sun, 10 Jul 2022 20:39:11 +0000 (22:39 +0200)
committerGreg Hurrell <greg@hurrell.net>
Sun, 10 Jul 2022 20:39:11 +0000 (22:39 +0200)
As mentioned in parent commit.

src/Size.react.js

index 66b443e6104025cf5d16727d9de4be59f3ebe51e..8a5238230769ff320a7b3b7e7a511b01238c990e 100644 (file)
@@ -9,15 +9,7 @@ import React from 'react';
 import convert from './convert';
 
 export default function Size({value}) {
-  let roundup = 1;
-  let targetBase = 2;
-  if (value.base === 16) {
-    roundup = 4;
-    targetBase = 16;
-  }
-  const bits = value ?
-    convert(value.value, value.base, targetBase).length * roundup :
-    0;
+  const bits = value ? convert(value.value, value.base, 2).length: 0;
   const bytes = Math.ceil(bits / 8);
   return (
     <span>