Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MelodyPart perf improvement #79

Open
oggy22 opened this issue Jul 8, 2019 · 0 comments
Open

MelodyPart perf improvement #79

oggy22 opened this issue Jul 8, 2019 · 0 comments

Comments

@oggy22
Copy link
Owner

oggy22 commented Jul 8, 2019

MelodyPartList can improve perf by refactoring as: insert

class MelodyPartList
{
   struct NotePartChunck
   {
      NoteWithDuration nwd;
      MelodyPart mp;
   }
   private List<NotePartChunk> npc;

  void AssertValid()
  {
    for (int i=0; i<npc.lenght; i++)
    {
        if (i!=0) Debug.Assert(npc.nwd.Count != 0);
        if (i!=npc.Lenght-1) Debug.Assert(npc.mp.Count != 0);
    }
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant