Commit e58bdb3b0c70dc13fad1acb1bf9e062dd4e331ac
1 parent
0b4dd034
update...
Showing
1 changed file
with
7 additions
and
2 deletions
src/main/java/com/bsth/client/GpsBeforeBuffer.java
| @@ -40,13 +40,18 @@ public class GpsBeforeBuffer implements CommandLineRunner{ | @@ -40,13 +40,18 @@ public class GpsBeforeBuffer implements CommandLineRunner{ | ||
| 40 | public static List<GpsEntity> pollAll(){ | 40 | public static List<GpsEntity> pollAll(){ |
| 41 | List<GpsEntity> rs = new ArrayList<>(300); | 41 | List<GpsEntity> rs = new ArrayList<>(300); |
| 42 | GpsEntity gps; | 42 | GpsEntity gps; |
| 43 | - while (true){ | 43 | + int size = linkedList.size(); |
| 44 | + for(int j = 0; j < size; j++){ | ||
| 45 | + gps = linkedList.poll(); | ||
| 46 | + rs.add(gps); | ||
| 47 | + } | ||
| 48 | + /*while (true){ | ||
| 44 | gps = linkedList.poll(); | 49 | gps = linkedList.poll(); |
| 45 | if(gps == null){ | 50 | if(gps == null){ |
| 46 | break; | 51 | break; |
| 47 | } | 52 | } |
| 48 | rs.add(gps); | 53 | rs.add(gps); |
| 49 | - } | 54 | + }*/ |
| 50 | 55 | ||
| 51 | log.info("poll size: " + rs.size()); | 56 | log.info("poll size: " + rs.size()); |
| 52 | return rs; | 57 | return rs; |