mirror of
https://github.com/VectorCamp/vectorscan.git
synced 2025-11-15 17:02:14 +03:00
Bug fix/clang-tidy-performance (#300)
Various clang-tidy-performance fixes: * noexcept * performance-noexcept-swap * performance * performance-move-const-arg * performance-unnecessary-value-param * performance-inefficient-vector-operation * performance-no-int-to-ptr * add performance * performance-inefficient-string-concatenation * clang-analyzer-deadcode.DeadStores * performance-inefficient-vector-operation * clang-analyzer-core.NullDereference * clang-analyzer-core.UndefinedBinaryOperatorResult * clang-analyzer-core.CallAndMessage --------- Co-authored-by: gtsoul-tech <gtsoulkanakis@gmail.com>
This commit is contained in:
@@ -96,7 +96,7 @@ hs_database_t * loadDatabase(const char *filename, bool verbose) {
|
||||
|
||||
bytes = reinterpret_cast<char *>(mmap(nullptr, len, PROT_READ, MAP_SHARED, fd, 0));
|
||||
if (bytes == MAP_FAILED) {
|
||||
cout << "mmap failed" << endl;
|
||||
cout << "mmap failed\n";
|
||||
close(fd);
|
||||
return nullptr;
|
||||
}
|
||||
@@ -110,7 +110,7 @@ hs_database_t * loadDatabase(const char *filename, bool verbose) {
|
||||
is.seekg(0, ios::end);
|
||||
size_t len = is.tellg();
|
||||
if (verbose) {
|
||||
cout << "Reading " << len << " bytes" << endl;
|
||||
cout << "Reading " << len << " bytes\n";
|
||||
}
|
||||
is.seekg(0, ios::beg);
|
||||
bytes = new char[len];
|
||||
@@ -130,7 +130,7 @@ hs_database_t * loadDatabase(const char *filename, bool verbose) {
|
||||
cout << "Serialized database info: " << info << endl;
|
||||
std::free(info);
|
||||
} else {
|
||||
cout << "Unable to decode serialized database info." << endl;
|
||||
cout << "Unable to decode serialized database info.\n";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user