-
-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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 SparseArrayCompat. #8895
Use SparseArrayCompat. #8895
Conversation
9b8c250
to
cbc363a
Compare
Kudos, SonarCloud Quality Gate passed! |
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.
app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java
Outdated
Show resolved
Hide resolved
app/src/main/java/org/schabi/newpipe/util/StreamItemAdapter.java
Outdated
Show resolved
Hide resolved
Log.d(TAG, "Clearing seekbarPreviewData"); | ||
seekbarPreviewData.clear(); | ||
synchronized (seekbarPreviewData) { |
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.
Why is synchronized
now needed?
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.
Android's sparse arrays are not thread-safe, so I added that to avoid potential issues.
Sorry about that, will do. My bad again, I'll restore the text. Thanks for the review! |
Make additional small improvements as well.
cbc363a
to
d661700
Compare
Kudos, SonarCloud Quality Gate passed! |
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.
Thank you! I tested thoroughly and it works
What is it?
Description of the changes in your PR
SparseArrayCompat
to reduce memory usage in the thumbnail preview, search and download functionality by avoiding integer boxing.StreamItemAdapter
.Fixes the following issue(s)
APK testing
The APK can be found by going to the "Checks" tab below the title. On the left pane, click on "CI", scroll down to "artifacts" and click "app" to download the zip file which contains the debug APK of this PR.
Due diligence