Skip to content
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

Use for instead of forEach with ranges #1035

Merged
merged 2 commits into from
Aug 8, 2023

Conversation

jmartinesp
Copy link
Member

@jmartinesp jmartinesp commented Aug 8, 2023

forEach is several times slower when used with ranges: https://medium.com/mobile-app-development-publication/kotlin-for-loop-vs-foreach-7eb594960333

This was discovered by a detekt rule in another branch which won't be merged.

`forEach` is several times slower when used with ranges.
@jmartinesp jmartinesp requested a review from a team as a code owner August 8, 2023 06:59
@jmartinesp jmartinesp requested review from ganfra and removed request for a team August 8, 2023 06:59
@github-actions
Copy link
Contributor

github-actions bot commented Aug 8, 2023

📱 Scan the QR code below to install the build (arm64 only) for this PR.
QR code
If you can't scan the QR code you can install the build via this link: https://i.diawi.com/A7ksdt

@sonarcloud
Copy link

sonarcloud bot commented Aug 8, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@codecov
Copy link

codecov bot commented Aug 8, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (ca63beb) 56.90% compared to head (2ac288e) 56.91%.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #1035   +/-   ##
========================================
  Coverage    56.90%   56.91%           
========================================
  Files          994      994           
  Lines        25291    25290    -1     
  Branches      5121     5122    +1     
========================================
  Hits         14393    14393           
+ Misses        8624     8623    -1     
  Partials      2274     2274           
Files Changed Coverage Δ
...ibraries/androidutils/diff/DiffCacheInvalidator.kt 36.36% <0.00%> (+3.03%) ⬆️

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jmartinesp jmartinesp added this pull request to the merge queue Aug 8, 2023
Merged via the queue into develop with commit 598a63d Aug 8, 2023
@jmartinesp jmartinesp deleted the fix/jme/use-for-instead-of-foreach-with-range branch August 8, 2023 08:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants