Skip to content

Commit

Permalink
Simplify code
Browse files Browse the repository at this point in the history
  • Loading branch information
reimu committed Oct 3, 2023
1 parent f281515 commit a1f96dc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ function t(notes: string, steps: number): string {
return notes
.split("")
.map((key, i) => {
const pos = keys.findIndex((note) => note === key);
const pos = keys.indexOf(key);
if (pos === -1) return key; // assume this is other notation
const newPos = pos + steps;
if (newPos < 0 || newPos >= keys.length) {
Expand Down

0 comments on commit a1f96dc

Please sign in to comment.