Skip to content

Commit

Permalink
Remove redundant local variable
Browse files Browse the repository at this point in the history
  • Loading branch information
pilgr committed May 11, 2020
1 parent 08181bb commit 9f40a51
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions paperdb/src/main/java/io/paperdb/KeyLocker.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,8 @@ class KeyLocker {
private Semaphore global = new Semaphore(1, true);

void acquire(String key) {
int availablePermits = global.availablePermits();

// If global semaphore is acquired, wait until global operation is done
if (availablePermits == 0) {
if (global.availablePermits() == 0) {
global.acquireUninterruptibly();
global.release();
}
Expand Down

0 comments on commit 9f40a51

Please sign in to comment.