PR #21207: removed inline function

Imported from GitHub PR #21207

if one includes the header and does not link with coding.cc gets unresolved error. not the case when you just include extern functions and do not use them, more over this function does not seem to save so much being inlined.

Copybara import of the project:

  - 60ab66e7367b515945296bf4acbbb8b647218c90 removed inline function by Stefan Dyulgerov <stefan.dyulgerov@gmail.com>
  - ba7b6ed3388bcd37299c9574db218dd4ae1a99a4 Merge 60ab66e7367b515945296bf4acbbb8b647218c90 into 132d1... by Stefan Dyulgerov <stefan.dyulgerov@gmail.com>

COPYBARA_INTEGRATE_REVIEW=https://github.com/tensorflow/tensorflow/pull/21207 from kingofthebongo2008:clean_coding_refactor 60ab66e7367b515945296bf4acbbb8b647218c90
PiperOrigin-RevId: 236390630
This commit is contained in:
A. Unique TensorFlower 2019-03-01 15:35:32 -08:00 committed by TensorFlower Gardener
parent 269caf17e6
commit 05ccaff25c
2 changed files with 13 additions and 12 deletions

View File

@ -133,6 +133,17 @@ int VarintLength(uint64_t v) {
return len;
}
const char* GetVarint32Ptr(const char* p, const char* limit, uint32* value) {
if (p < limit) {
uint32 result = *(reinterpret_cast<const unsigned char*>(p));
if ((result & 128) == 0) {
*value = result;
return p + 1;
}
}
return GetVarint32PtrFallback(p, limit, value);
}
const char* GetVarint32PtrFallback(const char* p, const char* limit,
uint32* value) {
uint32 result = 0;

View File

@ -55,18 +55,8 @@ extern const char* GetVarint64Ptr(const char* p, const char* limit, uint64* v);
// Internal routine for use by fallback path of GetVarint32Ptr
extern const char* GetVarint32PtrFallback(const char* p, const char* limit,
uint32* value);
inline const char* GetVarint32Ptr(const char* p, const char* limit,
uint32* value) {
if (p < limit) {
uint32 result = *(reinterpret_cast<const unsigned char*>(p));
if ((result & 128) == 0) {
*value = result;
return p + 1;
}
}
return GetVarint32PtrFallback(p, limit, value);
}
extern const char* GetVarint32Ptr(const char* p, const char* limit,
uint32* value);
extern char* EncodeVarint32(char* dst, uint32 v);
extern char* EncodeVarint64(char* dst, uint64 v);