mirror of
https://github.com/ergochat/ergo.git
synced 2025-12-21 18:41:58 -08:00
bump buntdb to v1.2.3
Potentially fixes the database corruption seen on #1603
This commit is contained in:
parent
b022c34a23
commit
fd3cbab6ee
36 changed files with 912 additions and 324 deletions
21
vendor/github.com/tidwall/match/match.go
generated
vendored
21
vendor/github.com/tidwall/match/match.go
generated
vendored
|
|
@ -1,4 +1,4 @@
|
|||
// Match provides a simple pattern matcher with unicode support.
|
||||
// Package match provides a simple pattern matcher with unicode support.
|
||||
package match
|
||||
|
||||
import "unicode/utf8"
|
||||
|
|
@ -6,7 +6,7 @@ import "unicode/utf8"
|
|||
// Match returns true if str matches pattern. This is a very
|
||||
// simple wildcard match where '*' matches on any number characters
|
||||
// and '?' matches on any one character.
|
||||
|
||||
//
|
||||
// pattern:
|
||||
// { term }
|
||||
// term:
|
||||
|
|
@ -16,12 +16,16 @@ import "unicode/utf8"
|
|||
// '\\' c matches character c
|
||||
//
|
||||
func Match(str, pattern string) bool {
|
||||
return deepMatch(str, pattern)
|
||||
}
|
||||
|
||||
func deepMatch(str, pattern string) bool {
|
||||
if pattern == "*" {
|
||||
return true
|
||||
}
|
||||
return deepMatch(str, pattern)
|
||||
}
|
||||
func deepMatch(str, pattern string) bool {
|
||||
for len(pattern) > 1 && pattern[0] == '*' && pattern[1] == '*' {
|
||||
pattern = pattern[1:]
|
||||
}
|
||||
for len(pattern) > 0 {
|
||||
if pattern[0] > 0x7f {
|
||||
return deepMatchRune(str, pattern)
|
||||
|
|
@ -52,6 +56,13 @@ func deepMatch(str, pattern string) bool {
|
|||
}
|
||||
|
||||
func deepMatchRune(str, pattern string) bool {
|
||||
if pattern == "*" {
|
||||
return true
|
||||
}
|
||||
for len(pattern) > 1 && pattern[0] == '*' && pattern[1] == '*' {
|
||||
pattern = pattern[1:]
|
||||
}
|
||||
|
||||
var sr, pr rune
|
||||
var srsz, prsz int
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue