mirror of
https://github.com/Aider-AI/aider.git
synced 2025-05-29 16:54:59 +00:00
fix: Correct UUID percentage calculation in analytics method
This commit is contained in:
parent
fa85bdceed
commit
1a8949eea3
1 changed files with 3 additions and 1 deletions
|
@ -99,8 +99,10 @@ class Analytics:
|
||||||
|
|
||||||
# Convert percentage to hex threshold (1% = "04", 10% = "1a", etc)
|
# 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
|
# 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")
|
threshold = format(int(255 * percent / 100), "02x")
|
||||||
return uuid_str < threshold
|
return uuid_str[:2] <= threshold
|
||||||
|
|
||||||
def get_data_file_path(self):
|
def get_data_file_path(self):
|
||||||
data_file = Path.home() / ".aider" / "analytics.json"
|
data_file = Path.home() / ".aider" / "analytics.json"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue