File tree Expand file tree Collapse file tree 3 files changed +5
-38
lines changed Expand file tree Collapse file tree 3 files changed +5
-38
lines changed Original file line number Diff line number Diff line change @@ -398,20 +398,11 @@ let dec_of_pos_int64 x =
398
398
let c, d = Caml_int64. div_mod y wbase in
399
399
let e ,f = Caml_int64. div_mod (Caml_int64_extern. add modulus_l d) wbase in
400
400
let quotient =
401
- ref (Caml_int64_extern. add (Caml_int64_extern. add quotient_l c )
401
+ (Caml_int64_extern. add (Caml_int64_extern. add quotient_l c )
402
402
e) in
403
- let modulus = ref f in
404
- let s = ref
403
+ Caml_int64. to_string quotient ^
405
404
(Caml_string_extern. get_string_unsafe
406
- cvtbl (Caml_int64_extern. to_int modulus.contents)) in
407
-
408
- while quotient.contents <> 0L do
409
- let a, b = Caml_int64. div_mod (quotient.contents) wbase in
410
- quotient .contents< - a;
411
- modulus .contents< - b;
412
- s .contents< - Caml_string_extern. get_string_unsafe cvtbl (Caml_int64_extern. to_int modulus.contents) ^ s.contents ;
413
- done ;
414
- s.contents
405
+ cvtbl (Caml_int64_extern. to_int f))
415
406
else
416
407
Caml_int64. to_string x)
417
408
Original file line number Diff line number Diff line change @@ -585,7 +585,6 @@ function dec_of_pos_int64(x) {
585
585
/* hi */ 0 ,
586
586
/* lo */ 10
587
587
] ;
588
- var cvtbl = "0123456789" ;
589
588
var y = Caml_int64 . discard_sign ( x ) ;
590
589
var match = Caml_int64 . div_mod ( y , wbase ) ;
591
590
var match$1 = Caml_int64 . div_mod ( Caml_int64 . add ( /* int64 */ [
@@ -596,18 +595,7 @@ function dec_of_pos_int64(x) {
596
595
/* hi */ 214748364 ,
597
596
/* lo */ 3435973836
598
597
] , match [ 0 ] ) , match$1 [ 0 ] ) ;
599
- var modulus = match$1 [ 1 ] ;
600
- var s = cvtbl [ Caml_int64 . to_int32 ( modulus ) ] ;
601
- while ( Caml_int64 . neq ( quotient , /* int64 */ [
602
- /* hi */ 0 ,
603
- /* lo */ 0
604
- ] ) ) {
605
- var match$2 = Caml_int64 . div_mod ( quotient , wbase ) ;
606
- quotient = match$2 [ 0 ] ;
607
- modulus = match$2 [ 1 ] ;
608
- s = cvtbl [ Caml_int64 . to_int32 ( modulus ) ] + s ;
609
- } ;
610
- return s ;
598
+ return Caml_int64 . to_string ( quotient ) + "0123456789" [ Caml_int64 . to_int32 ( match$1 [ 1 ] ) ] ;
611
599
} else {
612
600
return Caml_int64 . to_string ( x ) ;
613
601
}
Original file line number Diff line number Diff line change @@ -585,7 +585,6 @@ function dec_of_pos_int64(x) {
585
585
/* hi */ 0 ,
586
586
/* lo */ 10
587
587
] ;
588
- var cvtbl = "0123456789" ;
589
588
var y = Caml_int64 . discard_sign ( x ) ;
590
589
var match = Caml_int64 . div_mod ( y , wbase ) ;
591
590
var match$1 = Caml_int64 . div_mod ( Caml_int64 . add ( /* int64 */ [
@@ -596,18 +595,7 @@ function dec_of_pos_int64(x) {
596
595
/* hi */ 214748364 ,
597
596
/* lo */ 3435973836
598
597
] , match [ 0 ] ) , match$1 [ 0 ] ) ;
599
- var modulus = match$1 [ 1 ] ;
600
- var s = cvtbl [ Caml_int64 . to_int32 ( modulus ) ] ;
601
- while ( Caml_int64 . neq ( quotient , /* int64 */ [
602
- /* hi */ 0 ,
603
- /* lo */ 0
604
- ] ) ) {
605
- var match$2 = Caml_int64 . div_mod ( quotient , wbase ) ;
606
- quotient = match$2 [ 0 ] ;
607
- modulus = match$2 [ 1 ] ;
608
- s = cvtbl [ Caml_int64 . to_int32 ( modulus ) ] + s ;
609
- } ;
610
- return s ;
598
+ return Caml_int64 . to_string ( quotient ) + "0123456789" [ Caml_int64 . to_int32 ( match$1 [ 1 ] ) ] ;
611
599
} else {
612
600
return Caml_int64 . to_string ( x ) ;
613
601
}
You can’t perform that action at this time.
0 commit comments