aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing/object/common.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2019-04-22 16:44:33 +0200
committerGitHub <noreply@github.com>2019-04-22 16:44:33 +0200
commit6d4408addbaec52b861012688df0f09b79362e42 (patch)
tree239d82105d8f8cffe0ccd727311482ffeab0371c /plumbing/object/common.go
parent78092a2843dc534d6f5ee2048f608d84c407bf46 (diff)
parent936f65dc143f091d5bdb3ee43cf11b06f6635cab (diff)
downloadgo-git-6d4408addbaec52b861012688df0f09b79362e42.tar.gz
Merge pull request #1125 from saracen/tree-walk-optimization
plumbing: TreeWalker performance improvement, bufio pool for objects
Diffstat (limited to 'plumbing/object/common.go')
-rw-r--r--plumbing/object/common.go12
1 files changed, 12 insertions, 0 deletions
diff --git a/plumbing/object/common.go b/plumbing/object/common.go
new file mode 100644
index 0000000..3591f5f
--- /dev/null
+++ b/plumbing/object/common.go
@@ -0,0 +1,12 @@
+package object
+
+import (
+ "bufio"
+ "sync"
+)
+
+var bufPool = sync.Pool{
+ New: func() interface{} {
+ return bufio.NewReader(nil)
+ },
+}