Skip to content

Commit

Permalink
Only compiling TrimSpace on linux.
Browse files Browse the repository at this point in the history
Incorporated change by zmodem at #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
  • Loading branch information
cmumford committed Dec 9, 2015
1 parent f8d205c commit 3c9ff3c
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions db/db_bench.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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])) {
Expand All @@ -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;
Expand Down

0 comments on commit 3c9ff3c

Please sign in to comment.