diff options
author | A. Unique TensorFlower <gardener@tensorflow.org> | 2018-03-22 10:21:59 -0700 |
---|---|---|
committer | TensorFlower Gardener <gardener@tensorflow.org> | 2018-03-22 10:26:30 -0700 |
commit | ed0c4037ec47e3a7d1e5d23514951e5256b8a30f (patch) | |
tree | 8e25a50570c03d40663e64c0b13f2e74349cb177 /tensorflow/core/lib/strings/strcat.h | |
parent | 010e3e401cef883aa0fff334d3f5e56a88e3f5e4 (diff) |
Small cleanup StrCat related number formatting
- Resolve inconsistency in return values (pointer to start vs end of buffer)
- Instead, return the number of chars written as this turns out to be most useful to callers
- Removes the need for redundant strlen calls.
PiperOrigin-RevId: 190085812
Diffstat (limited to 'tensorflow/core/lib/strings/strcat.h')
-rw-r--r-- | tensorflow/core/lib/strings/strcat.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/tensorflow/core/lib/strings/strcat.h b/tensorflow/core/lib/strings/strcat.h index b3ec14e448..fb2cd5bc7e 100644 --- a/tensorflow/core/lib/strings/strcat.h +++ b/tensorflow/core/lib/strings/strcat.h @@ -101,22 +101,22 @@ class AlphaNum { // A bool ctor would also convert incoming pointers (bletch). AlphaNum(int i32) // NOLINT(runtime/explicit) - : piece_(digits_, FastInt32ToBufferLeft(i32, digits_) - &digits_[0]) {} + : piece_(digits_, FastInt32ToBufferLeft(i32, digits_)) {} AlphaNum(unsigned int u32) // NOLINT(runtime/explicit) - : piece_(digits_, FastUInt32ToBufferLeft(u32, digits_) - &digits_[0]) {} + : piece_(digits_, FastUInt32ToBufferLeft(u32, digits_)) {} AlphaNum(long x) // NOLINT(runtime/explicit) - : piece_(digits_, FastInt64ToBufferLeft(x, digits_) - &digits_[0]) {} + : piece_(digits_, FastInt64ToBufferLeft(x, digits_)) {} AlphaNum(unsigned long x) // NOLINT(runtime/explicit) - : piece_(digits_, FastUInt64ToBufferLeft(x, digits_) - &digits_[0]) {} + : piece_(digits_, FastUInt64ToBufferLeft(x, digits_)) {} AlphaNum(long long int i64) // NOLINT(runtime/explicit) - : piece_(digits_, FastInt64ToBufferLeft(i64, digits_) - &digits_[0]) {} + : piece_(digits_, FastInt64ToBufferLeft(i64, digits_)) {} AlphaNum(unsigned long long int u64) // NOLINT(runtime/explicit) - : piece_(digits_, FastUInt64ToBufferLeft(u64, digits_) - &digits_[0]) {} + : piece_(digits_, FastUInt64ToBufferLeft(u64, digits_)) {} AlphaNum(float f) // NOLINT(runtime/explicit) - : piece_(digits_, strlen(FloatToBuffer(f, digits_))) {} + : piece_(digits_, FloatToBuffer(f, digits_)) {} AlphaNum(double f) // NOLINT(runtime/explicit) - : piece_(digits_, strlen(DoubleToBuffer(f, digits_))) {} + : piece_(digits_, DoubleToBuffer(f, digits_)) {} AlphaNum(Hex hex); // NOLINT(runtime/explicit) |