From 1a8949eea3fc37b982722d01959240b4a8b7a57f Mon Sep 17 00:00:00 2001 From: "Paul Gauthier (aider)" Date: Wed, 20 Nov 2024 17:58:18 -0800 Subject: [PATCH] fix: Correct UUID percentage calculation in analytics method --- aider/analytics.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/aider/analytics.py b/aider/analytics.py index baae92ae4..a1887e4a2 100644 --- a/aider/analytics.py +++ b/aider/analytics.py @@ -99,8 +99,10 @@ class Analytics: # Convert percentage to hex threshold (1% = "04", 10% = "1a", etc) # Using first 2 hex digits (0-ff) means each digit is 1/256 of the space + if percent == 0: + return False threshold = format(int(255 * percent / 100), "02x") - return uuid_str < threshold + return uuid_str[:2] <= threshold def get_data_file_path(self): data_file = Path.home() / ".aider" / "analytics.json"