Skip to content
This repository has been archived by the owner on Jan 6, 2023. It is now read-only.

Commit

Permalink
Use min() from Math instead of Integer
Browse files Browse the repository at this point in the history
Use min() from Math instead of Integer to allow code to compile for all Android API levels
  • Loading branch information
josephx86 authored Mar 29, 2018
1 parent 522ccfc commit d1e4c6c
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/main/java/fr/delthas/javamp3/Decoder.java
Original file line number Diff line number Diff line change
Expand Up @@ -1737,7 +1737,7 @@ private static void synth(SoundData soundData, float[] samples, int[] synthOffse
private static int read(MainDataReader reader, int bits) {
int number = 0;
while (bits > 0) {
int advance = Integer.min(bits, 8 - reader.current);
int advance = Math.min(bits, 8 - reader.current);
bits -= advance;
reader.current += advance;
number |= ((reader.array[reader.index] >>> (8 - reader.current)) & (0xFF >>> (8 - advance))) << bits;
Expand All @@ -1752,7 +1752,7 @@ private static int read(MainDataReader reader, int bits) {
private static int read(Buffer buffer, int bits) throws IOException {
int number = 0;
while (bits > 0) {
int advance = Integer.min(bits, 8 - buffer.current);
int advance = Math.min(bits, 8 - buffer.current);
bits -= advance;
buffer.current += advance;
if (bits != 0 && buffer.lastByte == -1) {
Expand Down

1 comment on commit d1e4c6c

@delthas
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hahaha nice one, android

Please sign in to comment.