Skip to content

Commit 3c9ff3c

Browse files
committed
Only compiling TrimSpace on linux.
Incorporated change by zmodem at google/leveldb#310 to fix issue bitcoin#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
1 parent f8d205c commit 3c9ff3c

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

db/db_bench.cc

+2
Original file line numberDiff line numberDiff line change
@@ -142,6 +142,7 @@ class RandomGenerator {
142142
}
143143
};
144144

145+
#if defined(__linux)
145146
static Slice TrimSpace(Slice s) {
146147
size_t start = 0;
147148
while (start < s.size() && isspace(s[start])) {
@@ -153,6 +154,7 @@ static Slice TrimSpace(Slice s) {
153154
}
154155
return Slice(s.data() + start, limit - start);
155156
}
157+
#endif
156158

157159
static void AppendWithSpace(std::string* str, Slice msg) {
158160
if (msg.empty()) return;

0 commit comments

Comments
 (0)