Skip to content

Commit

Permalink
apply suggestions from code review
Browse files Browse the repository at this point in the history
  • Loading branch information
hburn7 committed Dec 25, 2024
1 parent ba789c3 commit 602b005
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/actions/tournaments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -43,14 +43,9 @@ export async function tournamentSubmissionFormAction(
}

// Try to extract the id using regex
const match = MatchLinkPattern.exec(s);

if (match == null) {
return "<Invalid match link>";
}

const url = match[0];
return match ? parseFloat(url.substring(url.lastIndexOf('/') + 1)) : s;
return MatchLinkPattern.test(s)
? parseFloat(s.substring(s.lastIndexOf('/') + 1))
: s;
}),
beatmapIds: value => value
.split(/\r?\n/g)
Expand Down

0 comments on commit 602b005

Please sign in to comment.