[clang-tidy] use empty method (#895)

Found with readability-container-size-empty

Signed-off-by: Rosen Penev <rosenp@gmail.com>
This commit is contained in:
Rosen Penev
2020-06-15 15:23:40 -07:00
committed by GitHub
parent b2cd008717
commit dbb385bdf5

View File

@@ -68,14 +68,14 @@ int main(int argc, char** argv) {
} }
} }
if (N > 1 && !cache && filename == "") { if (N > 1 && !cache && filename.empty()) {
usage(); usage();
return -1; return -1;
} }
if (cache) { if (cache) {
std::string input; std::string input;
if (filename != "") { if (!filename.empty()) {
std::ifstream in(filename); std::ifstream in(filename);
input = read_stream(in); input = read_stream(in);
} else { } else {
@@ -87,7 +87,7 @@ int main(int argc, char** argv) {
run(in); run(in);
} }
} else { } else {
if (filename != "") { if (!filename.empty()) {
std::ifstream in(filename); std::ifstream in(filename);
for (int i = 0; i < N; i++) { for (int i = 0; i < N; i++) {
in.seekg(std::ios_base::beg); in.seekg(std::ios_base::beg);