1
0
Fork 0
forked from External/ergo

bump buntdb to v1.2.3

Potentially fixes the database corruption seen on #1603
This commit is contained in:
Shivaram Lingamneni 2021-04-01 20:45:15 -04:00
parent b022c34a23
commit fd3cbab6ee
36 changed files with 912 additions and 324 deletions

View file

@ -1 +0,0 @@
language: go

View file

@ -1,20 +1,17 @@
Match
=====
<a href="https://travis-ci.org/tidwall/match"><img src="https://img.shields.io/travis/tidwall/match.svg?style=flat-square" alt="Build Status"></a>
<a href="https://godoc.org/github.com/tidwall/match"><img src="https://img.shields.io/badge/api-reference-blue.svg?style=flat-square" alt="GoDoc"></a>
# Match
[![GoDoc](https://godoc.org/github.com/tidwall/match?status.svg)](https://godoc.org/github.com/tidwall/match)
Match is a very simple pattern matcher where '*' matches on any
number characters and '?' matches on any one character.
Installing
----------
## Installing
```
go get -u github.com/tidwall/match
```
Example
-------
## Example
```go
match.Match("hello", "*llo")
@ -23,10 +20,10 @@ match.Match("hello", "h*o")
```
Contact
-------
## Contact
Josh Baker [@tidwall](http://twitter.com/tidwall)
License
-------
## License
Redcon source code is available under the MIT [License](/LICENSE).

3
vendor/github.com/tidwall/match/go.mod generated vendored Normal file
View file

@ -0,0 +1,3 @@
module github.com/tidwall/match
go 1.15

View file

@ -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