-
Notifications
You must be signed in to change notification settings - Fork 10
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
DIA-4456 integrate core /meta-data
#835
Conversation
cmplibrary/src/androidTest/java/com/sourcepoint/cmplibrary/campaign/CampaignManagerImplTest.kt
Show resolved
Hide resolved
if (newRate != dataStorage.ccpaSampleRate) { | ||
dataStorage.ccpaSampleRate = newRate | ||
ccpa.sampleRate.let { newRate -> | ||
if (newRate.toDouble() != dataStorage.ccpaSampleRate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Once again, I am not sure how kotlin handles things, but a straight comparison of two values with floating point might be error-prone.
Based on my C# experience, I would drop this banger:
if( newRate.toDouble() - dataStorage.ccpaSampleRate > Math.Epsilon )
Where Math.Epsilon
is a really tiny value (0.000001 or similar).
Might be a false alarm, though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a very good point. I thought about it while coding, but forgot to address it.
mobile-core
as dependencySourcepointClient
intoNetworkClient
/meta-data
implementation/meta-data
code