Skip to content

Commit 2513a48

Browse files
committed
Use fixed amount to prevent integer overflow.
1 parent 78dd16d commit 2513a48

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

contrib/pg_xtm/tests/transfers.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,8 +125,8 @@ func transfer(id int, cCommits chan int, cAborts chan int, wg *sync.WaitGroup) {
125125

126126
start := time.Now()
127127
for myCommits < N_ITERATIONS {
128-
amount := 2*rand.Intn(2000) - 1
129-
//amount := 1
128+
//amount := 2*rand.Intn(2000) - 1
129+
amount := 1
130130
account1 := rand.Intn(N_ACCOUNTS)
131131
account2 := rand.Intn(N_ACCOUNTS)
132132

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy