You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@wicket.apache.org by sv...@apache.org on 2020/04/27 20:11:37 UTC

[wicket] 02/02: WICKET-6773 Improve performance of `getBehaviors` by returning `Collections.emptyList` instead of wrapping the empty result

This is an automated email from the ASF dual-hosted git repository.

svenmeier pushed a commit to branch wicket-8.x
in repository https://gitbox.apache.org/repos/asf/wicket.git

commit f7dc2205b42955220451bc2ac46daf9a2167e583
Author: Thomas Heigl <th...@gmail.com>
AuthorDate: Mon Apr 27 18:53:36 2020 +0200

    WICKET-6773 Improve performance of `getBehaviors` by returning `Collections.emptyList` instead of wrapping the empty result
---
 wicket-core/src/main/java/org/apache/wicket/Behaviors.java | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/wicket-core/src/main/java/org/apache/wicket/Behaviors.java b/wicket-core/src/main/java/org/apache/wicket/Behaviors.java
index 672cc57..aceb318 100644
--- a/wicket-core/src/main/java/org/apache/wicket/Behaviors.java
+++ b/wicket-core/src/main/java/org/apache/wicket/Behaviors.java
@@ -91,6 +91,9 @@ final class Behaviors implements IDetachable
 				}
 			}
 		}
+		if (subset.isEmpty()) {
+			return Collections.emptyList();
+		}
 		return Collections.unmodifiableList(subset);
 	}