@@ -3630,12 +3630,16 @@ public final Boolean call(T t1) {
3630
3630
* @see #countLong()
3631
3631
*/
3632
3632
public final Observable <Integer > count () {
3633
- return reduce (0 , new Func2 <Integer , T , Integer >() {
3633
+ return reduce (0 , CountHolder .INSTANCE );
3634
+ }
3635
+
3636
+ private static final class CountHolder {
3637
+ static final Func2 <Integer , Object , Integer > INSTANCE = new Func2 <Integer , Object , Integer >() {
3634
3638
@ Override
3635
- public final Integer call (Integer t1 , T t2 ) {
3636
- return t1 + 1 ;
3639
+ public final Integer call (Integer count , Object o ) {
3640
+ return count + 1 ;
3637
3641
}
3638
- }) ;
3642
+ };
3639
3643
}
3640
3644
3641
3645
/**
@@ -3657,14 +3661,18 @@ public final Integer call(Integer t1, T t2) {
3657
3661
* @see #count()
3658
3662
*/
3659
3663
public final Observable <Long > countLong () {
3660
- return reduce (0L , new Func2 <Long , T , Long >() {
3664
+ return reduce (0L , CountLongHolder .INSTANCE );
3665
+ }
3666
+
3667
+ private static final class CountLongHolder {
3668
+ static final Func2 <Long , Object , Long > INSTANCE = new Func2 <Long , Object , Long >() {
3661
3669
@ Override
3662
- public final Long call (Long t1 , T t2 ) {
3663
- return t1 + 1 ;
3670
+ public final Long call (Long count , Object o ) {
3671
+ return count + 1 ;
3664
3672
}
3665
- }) ;
3673
+ };
3666
3674
}
3667
-
3675
+
3668
3676
/**
3669
3677
* Returns an Observable that mirrors the source Observable, except that it drops items emitted by the
3670
3678
* source Observable that are followed by another item within a computed debounce duration.
0 commit comments