kirklund commented on a change in pull request #7440:
URL: https://github.com/apache/geode/pull/7440#discussion_r824944338
##########
File path:
geode-core/src/main/java/org/apache/geode/internal/cache/partitioned/RegionAdvisor.java
##########
@@ -180,19 +180,23 @@ public void processProfilesQueuedDuringInitialization() {
logger.trace(LogMarker.DISTRIBUTION_ADVISOR_VERBOSE,
"applying queued profile removal for all buckets for {}",
qbp.memberId);
}
- for (int i = 0; i < buckets.length; i++) {
- BucketAdvisor ba = buckets[i].getBucketAdvisor();
- int serial = qbp.serials[i];
- if (serial != ILLEGAL_SERIAL) {
- ba.removeIdWithSerial(qbp.memberId, serial, qbp.destroyed);
- }
- } // for
+ if (qbp.serials.length == 1) {
+
buckets[qbp.bucketId].getBucketAdvisor().removeIdWithSerial(qbp.memberId,
+ qbp.serials[0], qbp.destroyed);
+ } else {
+ for (int i = 0; i < buckets.length; i++) {
+ BucketAdvisor ba = buckets[i].getBucketAdvisor();
+ int serial = qbp.serials[i];
+ if (serial != ILLEGAL_SERIAL) {
+ ba.removeIdWithSerial(qbp.memberId, serial, qbp.destroyed);
+ }
+ } // for
Review comment:
Good place to extract this as a private method of its own. The purpose
isn't to allow multiple code paths to call it, just to keep methods shorter for
JIT optimization and make it more readable (if you use a good method name).
You might also consider renaming some local variables to avoid abbreviations
like `ba` and `qdp`. Maybe `advisor`. Not sure what a `qdp` is without going
back to the code now (I'm editing the feedback which doesn't show the
declaration of that var).
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]