private Worker getWorker(Runnable task) { int key; if (task instanceof StripedRunnable) { key = ((StripedRunnable) task).getKey(); } else { key = rand.nextInt(); } int index = hashToIndex(key, size); return workers[index]; }
private Worker getWorker(Runnable command) { final int key; if (command instanceof StripedRunnable) { key = ((StripedRunnable) command).getKey(); } else { key = rand.nextInt(); } int index = hashToIndex(key, size); return workers[index]; }