Changeset 176 in tmcsimulator-scriptbuilder for trunk/src/scriptbuilder


Ignore:
Timestamp:
12/21/2019 09:27:51 AM (6 years ago)
Author:
sdanthin
Message:

TimeSlice?.java updated to complete removeCorrespondingAudioEvent search loop. Now removes after loop finishes.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/scriptbuilder/structures/TimeSlice.java

    r174 r176  
    326326    public void removeCorrespondingAudioEvent(I_AudioEvent comparisonEvent){ 
    327327        String id = comparisonEvent.getID(); 
     328        I_ScriptEvent removable = null; 
    328329        for(I_ScriptEvent event : events) 
    329330        { 
     
    332333                if(id.equals(((AudioEvent) event).id)) 
    333334                { 
    334                     System.out.println("the event was deleted"); 
    335                     events.remove(event); 
    336                     //this break prevents a ConcurrentModificationException. Not sure if this is logically okay. 
    337                     break; 
     335                    removable = event; 
    338336                } 
    339337                 
    340338            } 
    341339        } 
     340        events.remove(removable); 
    342341    } 
    343342    public AudioEvent getCorrespondingAudioEvent(I_AudioEvent comparisonEvent) 
Note: See TracChangeset for help on using the changeset viewer.