fix: -Wsign-compare

This commit is contained in:
kuoi 2024-05-07 12:38:56 +08:00
parent c601a8b65f
commit 713742d668

View file

@ -58,7 +58,7 @@ void extract_characters(const std::string& line, const std::string& file,
const std::vector<int> positions) { const std::vector<int> positions) {
std::ofstream outfile(file, std::ios::app); std::ofstream outfile(file, std::ios::app);
std::string new_line; std::string new_line;
for (int pos : positions) { for (unsigned long pos : positions) {
if (pos <= line.length()) { if (pos <= line.length()) {
new_line += line[pos - 1]; // start from 0 new_line += line[pos - 1]; // start from 0
} }