recompute ovecSlice #2
2
pcre.go
2
pcre.go
@ -592,7 +592,7 @@ func (r *Regexp) SetCallout(fn func(cb *CalloutBlock) int32) error {
|
|||||||
calloutStrBytes := unsafe.Slice((*byte)(unsafe.Pointer(ccb.Fcallout_string)), ccb.Fcallout_string_length)
|
calloutStrBytes := unsafe.Slice((*byte)(unsafe.Pointer(ccb.Fcallout_string)), ccb.Fcallout_string_length)
|
||||||
cb.CalloutString = string(calloutStrBytes)
|
cb.CalloutString = string(calloutStrBytes)
|
||||||
|
|
||||||
ovecSlice := unsafe.Slice((*lib.Tsize_t)(unsafe.Pointer(ccb.Foffset_vector)), (ccb.Fcapture_top*2)-1)
|
ovecSlice := unsafe.Slice((*lib.Tsize_t)(unsafe.Pointer(ccb.Foffset_vector)), 2+(ccb.Fcapture_top-1)*2)
|
||||||
|
|||||||
if len(ovecSlice) > 2 {
|
if len(ovecSlice) > 2 {
|
||||||
ovecSlice = ovecSlice[2:]
|
ovecSlice = ovecSlice[2:]
|
||||||
for i := 0; i < len(ovecSlice); i += 2 {
|
for i := 0; i < len(ovecSlice); i += 2 {
|
||||||
|
Loading…
Reference in New Issue
Block a user
The
2+
isn't needed because that's what theovecSlice = ovecSlice[2:]
line is for. Otherwise, this looks good, thanks.