royale-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ha...@apache.org
Subject [royale-asjs] branch develop updated: Made search case insensitive
Date Tue, 06 Feb 2018 16:19:18 GMT
This is an automated email from the ASF dual-hosted git repository.

harbs pushed a commit to branch develop
in repository https://gitbox.apache.org/repos/asf/royale-asjs.git


The following commit(s) were added to refs/heads/develop by this push:
     new 3380f32  Made search case insensitive
3380f32 is described below

commit 3380f32ee63f307e91e0113abfffbe0c69d3a1cf
Author: Harbs <harbs@in-tools.com>
AuthorDate: Tue Feb 6 18:19:11 2018 +0200

    Made search case insensitive
    
    Moved the regex construction out of the filter function for performance.
---
 examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
index 8b4cdce..a043933 100644
--- a/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
+++ b/examples/royale/ASDoc/src/main/royale/ASDocMainView.mxml
@@ -165,17 +165,17 @@ limitations under the License.
             		popUpList.width = searchTI.width;
             		popUpList.height = 200;
             	}
+                filterRegEx = new RegExp(searchTI.text,"i");
             	var arr:Array = (applicationModel as ASDocModel).allClasses.filter(filterClasses,
this);
             	if (arr.length < max_results)
 	            	popUpList.dataProvider = arr;
 	            else
 	            	popUpList.dataProvider = too_many;
             }
-            
+            private var filterRegEx:RegExp;
             private function filterClasses(item:String):Boolean
             {
-            	var regex:RegExp = new RegExp(searchTI.text);
-            	return regex.test(item);
+            	return filterRegEx.test(item);
             }
             
 		]]>

-- 
To stop receiving notification emails like this one, please contact
harbs@apache.org.

Mime
View raw message