Skip to content

Commit

Permalink
perf: use vector reserve
Browse files Browse the repository at this point in the history
  • Loading branch information
csirianni committed Nov 3, 2023
1 parent 8ca6000 commit ef5ed19
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 2 deletions.
1 change: 0 additions & 1 deletion backend/src/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ int main()
// test password
passwords.insert("TestPass1&");
db.execute("INSERT INTO passwords (password) VALUES ('TestPass1&');");
db.printTable("passwords");

// Enable CORS
crow::App<crow::CORSHandler> app;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/server.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ namespace server
CROW_ROUTE(app, "/passwords")
([passwords]()
{ crow::json::wvalue response;
// TODO: change this to be a list
std::vector<std::string> result;
result.reserve(passwords.size());
for (const auto &password : passwords)
{
result.push_back(password);
Expand Down

0 comments on commit ef5ed19

Please sign in to comment.