mirror of
https://github.com/openjdk/jdk.git
synced 2026-01-28 12:09:14 +00:00
8359996: Remove unnecessary List.indexOf key from Track.remove
Reviewed-by: aivanov, liach, azvegint
This commit is contained in:
parent
516197f50b
commit
fe7ec31259
@ -1,5 +1,5 @@
|
||||
/*
|
||||
* Copyright (c) 1999, 2017, Oracle and/or its affiliates. All rights reserved.
|
||||
* Copyright (c) 1999, 2025, Oracle and/or its affiliates. All rights reserved.
|
||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
||||
*
|
||||
* This code is free software; you can redistribute it and/or modify it
|
||||
@ -198,15 +198,8 @@ public final class Track {
|
||||
// Or: document that the ticks() length will not be reduced
|
||||
// by deleting events (unless the EOT event is removed)
|
||||
synchronized(eventsList) {
|
||||
if (set.remove(event)) {
|
||||
int i = eventsList.indexOf(event);
|
||||
if (i >= 0) {
|
||||
eventsList.remove(i);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
return set.remove(event) && eventsList.remove(event);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user