Speed up joinDigits by avoiding an extra copy
authorGreg Hurrell <greg@hurrell.net>
Wed, 31 May 2017 06:53:34 +0000 (23:53 -0700)
committerGreg Hurrell <greg@hurrell.net>
Wed, 31 May 2017 06:53:34 +0000 (23:53 -0700)
src/joinDigits.js

index 1f1ee74d2f738b7f2c1ae8bc529d99c7224d3be4..605313c8dbfc05515014f035a8d8d68cb680f6b5 100644 (file)
@@ -24,8 +24,7 @@ export default function joinDigits(
   base: number
 ): string {
   return digits
-    .slice()
-    .reverse()
     .map(number => encode(number, base))
+    .reverse()
     .join('');
 }