Commit 78a596f1 authored by Igor Sugak's avatar Igor Sugak Committed by Facebook Github Bot

fix -Wunused-variable

Summary:
Exposed by the latest clang:
```lang=bash
folly/test/FixedStringTest.cpp:52:36: error: unused variable 's' [-Werror,-Wunused-variable]
  constexpr folly::FixedString<42> s{"hello world"};
                                   ^
folly/gen/test/StringBenchmark.cpp:176:15: error: unused variable 'line' [-Werror,-Wunused-variable]
  StringPiece line(kLine);
              ^
```

Reviewed By: yfeldblum

Differential Revision: D6264853

fbshipit-source-id: 5cf4b0a8c99eaa31c2499746c70ddc49fdd73074
parent 29ffcc50
...@@ -173,7 +173,6 @@ BENCHMARK_RELATIVE(StringUnsplit_Old_ReusedBuffer, iters) { ...@@ -173,7 +173,6 @@ BENCHMARK_RELATIVE(StringUnsplit_Old_ReusedBuffer, iters) {
BENCHMARK_RELATIVE(StringUnsplit_Gen, iters) { BENCHMARK_RELATIVE(StringUnsplit_Gen, iters) {
size_t s = 0; size_t s = 0;
StringPiece line(kLine);
while (iters--) { while (iters--) {
fbstring joined = from(testStrVector) | unsplit(','); fbstring joined = from(testStrVector) | unsplit(',');
s += joined.size(); s += joined.size();
......
...@@ -50,6 +50,7 @@ TEST(FixedStringCtorTest, Default) { ...@@ -50,6 +50,7 @@ TEST(FixedStringCtorTest, Default) {
TEST(FixedStringCtorTest, FromLiterals) { TEST(FixedStringCtorTest, FromLiterals) {
constexpr folly::FixedString<42> s{"hello world"}; constexpr folly::FixedString<42> s{"hello world"};
static_assert(s[0] == 'h', "");
constexpr folly::FixedString<11> s2{"hello world"}; constexpr folly::FixedString<11> s2{"hello world"};
static_assert(s2[0] == 'h', ""); static_assert(s2[0] == 'h', "");
static_assert(s2[10] == 'd', ""); static_assert(s2[10] == 'd', "");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment