-
Notifications
You must be signed in to change notification settings - Fork 180
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
More refactoring and better performance at the cost of some more RAM
- Loading branch information
1 parent
84f97f8
commit 5cf7333
Showing
25 changed files
with
856 additions
and
937 deletions.
There are no files selected for viewing
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
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
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
package engine | ||
|
||
import ( | ||
"sync" | ||
) | ||
|
||
var dedupValues int | ||
var attributeValueDedupper map[AttributeValue]*AttributeValue | ||
var dedupLock sync.RWMutex | ||
|
||
func DedupValues(enable bool) { | ||
if enable { | ||
dedupValues++ | ||
} else { | ||
dedupValues-- | ||
} | ||
if dedupValues == 0 { | ||
attributeValueDedupper = nil | ||
} else if dedupValues > 0 && attributeValueDedupper == nil { | ||
attributeValueDedupper = make(map[AttributeValue]*AttributeValue) | ||
} | ||
} |
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
Oops, something went wrong.