[core] Improve how the selected keys are copied in SmackReactor

This commit is contained in:
Florian Schmaus 2023-12-06 20:56:03 +01:00
parent 844ebbf4c5
commit 9acee05e5e
1 changed files with 2 additions and 3 deletions

View File

@ -1,6 +1,6 @@
/** /**
* *
* Copyright 2018-2020 Florian Schmaus * Copyright 2018-2023 Florian Schmaus
* *
* Licensed under the Apache License, Version 2.0 (the "License"); * Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License. * you may not use this file except in compliance with the License.
@ -276,8 +276,7 @@ public class SmackReactor {
setInterestOpsCancelledKeySafe(selectionKey, 0); setInterestOpsCancelledKeySafe(selectionKey, 0);
} }
selectedKeys = new ArrayList<>(selectedKeySet.size()); selectedKeys = new ArrayList<>(selectedKeySet);
selectedKeys.addAll(selectedKeySet);
selectedKeySet.clear(); selectedKeySet.clear();
} }