aboutsummaryrefslogtreecommitdiff
path: root/src/digit_table.rs
diff options
context:
space:
mode:
authorYi Kong <yikong@google.com>2020-09-01 03:23:28 +0000
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2020-09-01 03:23:28 +0000
commit1f6fa1f83c341aee19bff406f7f2cd3563aec457 (patch)
tree91d0f8235ee35264b5f7296c6fb4fd79ac934c43 /src/digit_table.rs
parent3fe076ea96b51ea6270f832a295577aa0096ac6c (diff)
parent803bba2af0a90f36af2529862b636fd4627bb131 (diff)
downloadryu-1f6fa1f83c341aee19bff406f7f2cd3563aec457.tar.gz
Import 'ryu' crate version 1.0.5 am: ce81bb62a2 am: 261516ff4c am: 803bba2af0
Original change: https://android-review.googlesource.com/c/platform/external/rust/crates/ryu/+/1414669 Change-Id: I0e216108a077a132e5c74b2d89d75718c135dc87
Diffstat (limited to 'src/digit_table.rs')
-rw-r--r--src/digit_table.rs28
1 files changed, 28 insertions, 0 deletions
diff --git a/src/digit_table.rs b/src/digit_table.rs
new file mode 100644
index 0000000..d871f03
--- /dev/null
+++ b/src/digit_table.rs
@@ -0,0 +1,28 @@
+// Translated from C to Rust. The original C code can be found at
+// https://github.com/ulfjack/ryu and carries the following license:
+//
+// Copyright 2018 Ulf Adams
+//
+// The contents of this file may be used under the terms of the Apache License,
+// Version 2.0.
+//
+// (See accompanying file LICENSE-Apache or copy at
+// http://www.apache.org/licenses/LICENSE-2.0)
+//
+// Alternatively, the contents of this file may be used under the terms of
+// the Boost Software License, Version 1.0.
+// (See accompanying file LICENSE-Boost or copy at
+// https://www.boost.org/LICENSE_1_0.txt)
+//
+// Unless required by applicable law or agreed to in writing, this software
+// is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+// KIND, either express or implied.
+
+// A table of all two-digit numbers. This is used to speed up decimal digit
+// generation by copying pairs of digits into the final output.
+pub static DIGIT_TABLE: [u8; 200] = *b"\
+ 0001020304050607080910111213141516171819\
+ 2021222324252627282930313233343536373839\
+ 4041424344454647484950515253545556575859\
+ 6061626364656667686970717273747576777879\
+ 8081828384858687888990919293949596979899";