Skip to content

Commit

Permalink
Don't use regex when not necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
emmercm committed Apr 7, 2024
1 parent 5505dad commit f0d3e89
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/types/dats/game.ts
Original file line number Diff line number Diff line change
Expand Up @@ -263,8 +263,8 @@ export default class Game implements GameProps {
// Sometimes [!] can get mixed with [c], consider it not bad
return false;
}
return this.name.match(/\[c\]/) !== null // "known bad checksum but good dump"
|| this.name.match(/\[x\]/) !== null; // "thought to have a bad checksum"
return this.name.includes('[c]') // "known bad checksum but good dump"
|| this.name.includes('[x]'); // "thought to have a bad checksum"
}

/**
Expand Down Expand Up @@ -345,7 +345,7 @@ export default class Game implements GameProps {
* Is this game a pending dump (works, but isn't a proper dump)?
*/
isPendingDump(): boolean {
return this.name.match(/\[!p\]/) !== null;
return this.name.includes('[!p]');
}

/**
Expand Down Expand Up @@ -397,7 +397,7 @@ export default class Game implements GameProps {
* Is this game an explicitly verified dump?
*/
isVerified(): boolean {
return this.name.match(/\[!\]/) !== null;
return this.name.includes('[!]');
}

/**
Expand Down

0 comments on commit f0d3e89

Please sign in to comment.