Skip to content

Commit

Permalink
Minor fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
igabaydulin committed May 28, 2019
1 parent 56fe17f commit 064f419
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 6 deletions.
6 changes: 3 additions & 3 deletions lib/build.gradle
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
plugins {
id 'java'
id 'java-library'
id "me.champeau.gradle.jmh" version "0.4.8"
}

group 'com.github.igababydulin.collections'
group 'com.github.igabaydulin.collections'
version '0.1'

sourceCompatibility = 1.8
Expand All @@ -15,7 +15,7 @@ repositories {
dependencies {
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.4.2'
testImplementation 'org.junit.jupiter:junit-jupiter-params:5.4.2'

testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.4.2'
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-params:5.4.2'
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
import com.github.igabaydulin.collections.utils.Reference;
import java.util.NavigableSet;

interface Treap<T> extends NavigableSet<T> {
public interface Treap<T> extends NavigableSet<T> {

T get(int index);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -268,24 +268,24 @@ public boolean contains(K value) {
return get(value) != null;
}

@SuppressWarnings("unchecked")
@Override
public V get(Object key) {
if (isEmpty()) {
return null;
}

//noinspection unchecked
return root.get((K) key);
}

@SuppressWarnings("unchecked")
@Override
public V remove(Object key) {
if (isEmpty()) {
return null;
}

Reference<V> removedValue = new Reference<>();
//noinspection unchecked
root = root.delete((K) key, removedValue);

return removedValue.get();
Expand Down

0 comments on commit 064f419

Please sign in to comment.