|
59 | 59 | * memcached server. |
60 | 60 | * |
61 | 61 | * @author Xingen Wang |
62 | | - * @since 2.5.1 |
| 62 | + * @since 2.5.0 |
63 | 63 | * @see BinaryClient |
64 | 64 | */ |
65 | 65 | public class AscIIClient extends MemCachedClient { |
@@ -470,35 +470,35 @@ private boolean set(String cmdname, String key, Object value, Date expiry, Integ |
470 | 470 | } |
471 | 471 |
|
472 | 472 | public long addOrIncr(String key) { |
473 | | - return addOrIncr(key, 1, null); |
| 473 | + return addOrIncr(key, 0, null); |
474 | 474 | } |
475 | 475 |
|
476 | 476 | public long addOrIncr(String key, long inc) { |
477 | 477 | return addOrIncr(key, inc, null); |
478 | 478 | } |
479 | 479 |
|
480 | 480 | public long addOrIncr(String key, long inc, Integer hashCode) { |
481 | | - boolean ret = add(key, "0", hashCode); |
| 481 | + boolean ret = add(key, "" + inc, hashCode); |
482 | 482 |
|
483 | 483 | if (ret) { |
484 | | - return 0; |
| 484 | + return inc; |
485 | 485 | } else { |
486 | 486 | return incrdecr("incr", key, inc, hashCode); |
487 | 487 | } |
488 | 488 | } |
489 | 489 |
|
490 | 490 | public long addOrDecr(String key) { |
491 | | - return addOrDecr(key, 1, null); |
| 491 | + return addOrDecr(key, 0, null); |
492 | 492 | } |
493 | 493 |
|
494 | 494 | public long addOrDecr(String key, long inc) { |
495 | 495 | return addOrDecr(key, inc, null); |
496 | 496 | } |
497 | 497 |
|
498 | 498 | public long addOrDecr(String key, long inc, Integer hashCode) { |
499 | | - boolean ret = add(key, "0", hashCode); |
| 499 | + boolean ret = add(key, "" + inc, hashCode); |
500 | 500 | if (ret) { |
501 | | - return 0; |
| 501 | + return inc; |
502 | 502 | } else { |
503 | 503 | return incrdecr("decr", key, inc, hashCode); |
504 | 504 | } |
|
0 commit comments