Skip to content

Instantly share code, notes, and snippets.

@steveyen
Created August 3, 2016 18:13
Show Gist options
  • Save steveyen/c53027e1aff29a1d721ac19592999de7 to your computer and use it in GitHub Desktop.
Save steveyen/c53027e1aff29a1d721ac19592999de7 to your computer and use it in GitHub Desktop.
Steves-MacBook-Pro:bleve steveyen$ git diff
diff --git a/index/index.go b/index/index.go
index 880c35f..77e4d46 100644
--- a/index/index.go
+++ b/index/index.go
@@ -123,7 +123,9 @@ type TermFieldDoc struct {
}
func (tfd *TermFieldDoc) Reset() *TermFieldDoc {
+ id := tfd.ID
*tfd = TermFieldDoc{}
+ tfd.ID = id[:0]
return tfd
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment