Просмотр исходного кода

refactor: simplify post-boundary +1 to intuitive 50% chance based on seed

Co-authored-by: RPRX <[email protected]>
copilot-swe-agent[bot] 4 месяцев назад
Родитель
Сommit
cb325e51ea
1 измененных файлов с 2 добавлено и 4 удалено
  1. 2 4
      common/utils/browser.go

+ 2 - 4
common/utils/browser.go

@@ -25,10 +25,8 @@ func ChromeVersion() int {
 			ver--
 		}
 	} else {
-		// After boundary: uniformly distributed whether +1
-		lastDay := time.Date(now.Year(), now.Month()+1, 0, 0, 0, 0, 0, now.Location()).Day()
-		daysAfter := lastDay - boundary + 1
-		if seed%daysAfter < day-boundary+1 {
+		// After boundary: 50% chance to +1 based on seed
+		if seed%2 == 1 {
 			ver++
 		}
 	}