Skip to content

Commit

Permalink
refactor: no need check TtlEnhanced type in `CffuTtlExecutorWrapper…
Browse files Browse the repository at this point in the history
…Provider`

already done in `TtlExecutors.getTtlExecutor`
  • Loading branch information
oldratlee committed Feb 16, 2025
1 parent f935e5c commit 30964af
Showing 1 changed file with 1 addition and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package io.foldright.cffu.ttl;

import com.alibaba.ttl.spi.TtlEnhanced;
import com.alibaba.ttl.threadpool.TtlExecutors;
import edu.umd.cs.findbugs.annotations.NonNull;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
Expand All @@ -24,8 +23,6 @@ public final class CffuTtlExecutorWrapperProvider implements ExecutorWrapperProv
@Override
@SuppressFBWarnings("NP_NULL_ON_SOME_PATH_FROM_RETURN_VALUE")
public Executor wrap(@NonNull Executor executor) {
requireNonNull(executor, "executor is null");
if (executor instanceof TtlEnhanced) return executor;
return TtlExecutors.getTtlExecutor(executor);
return TtlExecutors.getTtlExecutor(requireNonNull(executor, "executor is null"));
}
}

0 comments on commit 30964af

Please sign in to comment.