Created
October 1, 2018 21:27
-
-
Save berfarah/3054ea45162e0c6f51c6abfdb522b1f2 to your computer and use it in GitHub Desktop.
Iterative Optimization on Hot Paths: Optimization 1: Pass by value
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Valuer creates a sql/driver.Valuer from the type and value. | |
-func (d Descriptor) Valuer(val reflect.Value) Valuer { | |
+func (d *Descriptor) Valuer(val reflect.Value) Valuer { | |
- return Valuer{Descriptor: &d, value: val} | |
+ return Valuer{Descriptor: d, value: val} | |
} | |
// Scanner creates a sql.Scanner from the descriptor. | |
-func (d Descriptor) Scanner() *Scanner { return &Scanner{Descriptor: &d} } | |
+func (d *Descriptor) Scanner() *Scanner { return &Scanner{Descriptor: d} } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment