Skip to content

Commit

Permalink
feat: listenrId=-1 表示从存活列表获取一个,目标是增加方便性,以提高效率
Browse files Browse the repository at this point in the history
  • Loading branch information
qxo committed Oct 28, 2023
1 parent e638b97 commit 73a1371
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,10 @@ public static void unReg(AdviceListener listener) {
}
}

public static AdviceListener listener(long id) {
public static AdviceListener listener(final long id) {
if (id == -1 && advices.size() > 0) {
return advices.entrySet().iterator().next().getValue();
}
return advices.get(id);
}

Expand Down

0 comments on commit 73a1371

Please sign in to comment.