Author: ggregory
Date: Sun Aug 7 17:11:32 2011
New Revision: 1154730
URL: http://svn.apache.org/viewvc?rev=1154730&view=rev
Log:
Factor out constant answer in a singleton to save lots of memory on start up.
Modified:
commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
Modified:
commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
URL:
http://svn.apache.org/viewvc/commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java?rev=1154730&r1=1154729&r2=1154730&view=diff
==============================================================================
---
commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
(original)
+++
commons/proper/codec/trunk/src/java/org/apache/commons/codec/language/bm/Rule.java
Sun Aug 7 17:11:32 2011
@@ -213,10 +213,16 @@ public class Rule {
boolean find();
}
+ /**
+ * Always returns true.
+ */
private static class TrueRMatcher implements RMatcher {
private static TrueRMatcher INSTANCE = new TrueRMatcher();
+ /**
+ * Always returns true.
+ */
public boolean find() {
return true;
}