Skip to content

Commit

Permalink
Merge pull request #56 from marianobarrios/use-release-flag
Browse files Browse the repository at this point in the history
Use release flag
  • Loading branch information
marianobarrios authored Jul 7, 2024
2 parents 9478cf4 + ea5e163 commit 9ad7626
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 8 deletions.
10 changes: 6 additions & 4 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -16,14 +16,16 @@ java {
}

compileJava {
sourceCompatibility = '8'
targetCompatibility = '8'
if (javaToolchain != "8") {
options.release = 8
}
options.compilerArgs.add('-Xlint')
}

compileTestJava {
sourceCompatibility = '8'
targetCompatibility = '8'
if (javaToolchain != "8") {
options.release = 8
}
options.compilerArgs.add('-Xlint')
}

Expand Down
8 changes: 4 additions & 4 deletions src/main/java/lbmq/LinkedBlockingMultiQueue.java
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,7 @@ SubQueue getNextSubQueue() {
if (nextIdx == queues.size()) {
nextIdx = 0;
}
if (child.enabled && child.size() > 0) {
if (child.enabled && !child.isEmpty()) {
return child;
}
} while (nextIdx != startIdx);
Expand All @@ -182,7 +182,7 @@ int drainTo(Collection<? super E> c, int maxElements) {
if (nextIdx == queues.size()) {
nextIdx = 0;
}
if (child.enabled && child.size() > 0) {
if (child.enabled && !child.isEmpty()) {
emptyQueues = 0;
c.add(child.dequeue());
drained += 1;
Expand All @@ -202,7 +202,7 @@ E peek() {
int startIdx = nextIdx;
do {
SubQueue child = queues.get(nextIdx);
if (child.enabled && child.size() > 0) {
if (child.enabled && !child.isEmpty()) {
return child.head.next.item;
} else {
nextIdx += 1;
Expand Down Expand Up @@ -282,7 +282,7 @@ public SubQueue removeSubQueue(K key) {
SubQueue removed = subQueues.remove(key);
if (removed != null) {
removed.priorityGroup.removeQueue(removed);
if (removed.priorityGroup.queues.size() == 0) {
if (removed.priorityGroup.queues.isEmpty()) {
this.priorityGroups.remove(removed.priorityGroup);
}
}
Expand Down

0 comments on commit 9ad7626

Please sign in to comment.