mirror of
https://github.com/google/leveldb.git
synced 2024-11-27 15:39:03 +08:00
Only compiling TrimSpace on linux.
Incorporated change by zmodem at https://github.com/google/leveldb/pull/310 to fix issue #310. This change will only build TrimSace on linux to avoid unused function warning/error. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=105323419
This commit is contained in:
parent
f79f4180cc
commit
1a9648e1f5
@ -142,6 +142,7 @@ class RandomGenerator {
|
||||
}
|
||||
};
|
||||
|
||||
#if defined(__linux)
|
||||
static Slice TrimSpace(Slice s) {
|
||||
size_t start = 0;
|
||||
while (start < s.size() && isspace(s[start])) {
|
||||
@ -153,6 +154,7 @@ static Slice TrimSpace(Slice s) {
|
||||
}
|
||||
return Slice(s.data() + start, limit - start);
|
||||
}
|
||||
#endif
|
||||
|
||||
static void AppendWithSpace(std::string* str, Slice msg) {
|
||||
if (msg.empty()) return;
|
||||
|
Loading…
Reference in New Issue
Block a user