Skip to content

Commit

Permalink
reduce races
Browse files Browse the repository at this point in the history
  • Loading branch information
sdfsdhgjkbmnmxc committed Jul 15, 2021
1 parent fa818ca commit 5083530
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 3 additions & 0 deletions CHANGELOG.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
v0.10.5
* reduce races

v0.10.4
* reduce races

Expand Down
2 changes: 1 addition & 1 deletion op/cache.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ const maxGrowth = 5 * 1024

func maybeGrow(s string, mx *int32) string {
n := int32(len(s))
if mxValue := atomic.LoadInt32(mx); mxValue < maxGrowth && n > *mx {
if mxValue := atomic.LoadInt32(mx); mxValue < maxGrowth && n > mxValue {
atomic.StoreInt32(mx, n)
}
return s
Expand Down

0 comments on commit 5083530

Please sign in to comment.