Skip to content

Commit

Permalink
[#10] Not yet sure if genius or madness: Tried asking DeepSeek for su…
Browse files Browse the repository at this point in the history
…ggestions.


(The `while` loops are definitely a good idea, but the more pertinent question here is whether the rest of the code will work or crash spectacularly... we shall see!)
  • Loading branch information
DaloLorn authored Jan 29, 2025
1 parent 59bdd72 commit 70afff7
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions source/game/scripts/manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -487,25 +487,25 @@ void parseFile(Manager* man, File& fl, const std::string& filename, bool cacheFi
// TODO: Figure out something a little better-optimized than always running
// three regexes on every line of code?
// On the bright side, we're only running them if we're in the right section...
if(reg_match(line, match, pre_osr_single_line)) {
while(reg_match(line, match, pre_osr_single_line)) {
const std::string prefix = reg_str(line, match, 1);
const std::string postfix = reg_str(line, match, 4);
if(matchesCompilerVersion(reg_str(line, match, 2), reg_str(line, match, 3))) {
line = prefix + postfix;
*iLine = prefix + postfix;
}
}
if(reg_match(line, match, pre_osr_multi_open)) {
while(reg_match(line, match, pre_osr_multi_open)) {
const std::string prefix = reg_str(line, match, 1);
const std::string postfix = reg_str(line, match, 4);
if(matchesCompilerVersion(reg_str(line, match, 2), reg_str(line, match, 3))) {
line = prefix + postfix;
*iLine = prefix + postfix;
}
}
if(reg_match(line, match, pre_osr_multi_close)) {
while(reg_match(line, match, pre_osr_multi_close)) {
const std::string prefix = reg_str(line, match, 1);
const std::string postfix = reg_str(line, match, 4);
if(matchesCompilerVersion(reg_str(line, match, 2), reg_str(line, match, 3))) {
line = prefix + postfix;
*iLine = prefix + postfix;
}
}

Expand Down

1 comment on commit 70afff7

@DaloLorn
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The poor thing tried to replace the regexes with calls to find() and erase(), and didn't have enough spare resources to sanity-check my attempt at applying its other suggestions. I guess that's what I get for not hosting my own instance like all the cool kids... 😢

Please sign in to comment.