mirror of
https://github.com/dolthub/dolt.git
synced 2026-02-05 02:59:44 -06:00
Merge pull request #78 from cmasone-attic/reminders
Add a few reminder comments about hot-paths
This commit is contained in:
@@ -129,7 +129,7 @@ func (w *fileChunkWriter) Close() error {
|
||||
totalBytes := w.buffer.Len()
|
||||
written, err := file.Write(w.buffer.Bytes())
|
||||
Chk.NoError(err)
|
||||
Chk.Equal(totalBytes, written, "Too few bytes written.")
|
||||
Chk.True(totalBytes == written, "Too few bytes written.") // Hot path!
|
||||
|
||||
w.buffer = nil
|
||||
return nil
|
||||
|
||||
@@ -75,7 +75,7 @@ func MustParse(s string) Ref {
|
||||
// Particularly, Chk.Equals{Value} does reflection, and this can be expensive, so avoid it here.
|
||||
func Less(r1, r2 Ref) bool {
|
||||
d1, d2 := r1.digest, r2.digest
|
||||
Chk.True(len(d1) == len(d2))
|
||||
Chk.True(len(d1) == len(d2)) // Hot path!
|
||||
for k := 0; k < len(d1); k++ {
|
||||
b1, b2 := d1[k], d2[k]
|
||||
if b1 < b2 {
|
||||
|
||||
Reference in New Issue
Block a user