[hackers] [sbase] split: dont use table lookup for size || Hiltjo Posthuma
commit bd9a81951f4e55c247d29312b893be96c05b08ae
Author: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
Date: Tue Apr 1 15:30:17 2014 +0200
split: dont use table lookup for size
Signed-off-by: Hiltjo Posthuma <hiltjo_AT_codemadness.org>
diff --git a/split.c b/split.c
index 1268f19..8c04ee9 100644
--- a/split.c
+++ b/split.c
_AT_@ -22,15 +22,10 @@ main(int argc, char **argv)
char *prefix = "x";
char *file = NULL;
char *tmp, *end;
- uint64_t sizes['M'+1];
uint64_t size = 1000, scale, n;
int always = 0;
FILE *in=stdin, *out=NULL;
- sizes['K'] = 1024;
- sizes['M'] = 1024L*1024L;
- sizes['G'] = 1024L*1024L*1024L;
-
ARGBEGIN {
case 'b':
always = 1;
_AT_@ -41,9 +36,19 @@ main(int argc, char **argv)
size = strtoull(tmp, &end, 10);
if(*end == '
Received on Tue Apr 01 2014 - 17:20:55 CEST
This archive was generated by hypermail 2.3.0
: Tue Apr 01 2014 - 17:24:32 CEST