$hfind seek distance limited - 12/10/18 04:32 PM
Somewhere between 6.35 and current, $hfind changed to no longer search past the 'line length limit'.
Results from different versions:
Edit:
The above was for wildcard match. For regex match, 6.35 couldn't see past the line length limit like it could for wildcard match. (Thanks Wims) For the below, 6.35 matches at %len 4150 but not 4151. In the newest beta, regex's limit is %len 8292
Results from different versions:
Quote:
1 vs 1 123456791 6.35 /hfind_test 123456789
1 vs 0 4151 7.52 /hfind_test 4149
1 vs 0 8293 7.52 1265 /hfind_test 8291
1 vs 0 4151 7.52 /hfind_test 4149
1 vs 0 8293 7.52 1265 /hfind_test 8291
Code:
alias hfind_test { bset -t &var $1 abc noop because hfind won't search past 0x00: | breplace &var 0 $asc(a) hadd -bm table item &var echo 4 $hfind(table, *b*, 0, w).data vs $hfind(table, *c*, 0, w).data $bvar(&var,0) $version $beta /hfind_test $1 hdel table item }
Edit:
The above was for wildcard match. For regex match, 6.35 couldn't see past the line length limit like it could for wildcard match. (Thanks Wims) For the below, 6.35 matches at %len 4150 but not 4151. In the newest beta, regex's limit is %len 8292
Code:
//var %len 4151 | bset -t &var %len b | breplace &var 0 $asc(a) | hadd -bm table item &var | echo 4 $hfind(table, (a*b$), 0, r).data $bvar(&var,0)