mirror of
https://github.com/GTNewHorizons/BetterP2P.git
synced 2026-11-21 20:42:32 +00:00
Optimize search method
This commit is contained in:
1 parent
fd132c5263
commit
5e9690fb83
1 file changed
+5
-1
@@ -89,7 +89,11 @@ class GuiAdvancedMemoryCard(msg: S2CListP2P) : GuiScreen(), TextureBound {
|
||||
}
|
||||
|
||||
private fun reGenInfoFromText() {
|
||||
var tmpInfo = infos.filter { it.frequency.toHexString().contains(searchBar.text) || it.frequency.toHexString().format4().contains(searchBar.text) || it.name.contains(searchBar.text) }
|
||||
var tmpInfo = infos.filter {
|
||||
it.frequency.toHexString().lowercase().contains(searchBar.text.lowercase()) ||
|
||||
it.frequency.toHexString().format4().contains(searchBar.text.uppercase()) ||
|
||||
it.name.lowercase().contains(searchBar.text.lowercase())
|
||||
}
|
||||
if (searchBar.text.isEmpty())
|
||||
tmpInfo = infos
|
||||
sortedInfo = tmpInfo.sortedBy {
|
||||
|
||||
Reference in new issue
Block a user