compareRevIDs compares the two rev IDs and returns: 1 if id1 is 'greater' than id2 -1 if id1 is 'less' than id2 0 if the two are equal.
(ctx context.Context, id1, id2 string)
| 463 | // -1 if id1 is 'less' than id2 |
| 464 | // 0 if the two are equal. |
| 465 | func compareRevIDs(ctx context.Context, id1, id2 string) int { |
| 466 | gen1, sha1 := ParseRevID(ctx, id1) |
| 467 | gen2, sha2 := ParseRevID(ctx, id2) |
| 468 | switch { |
| 469 | case gen1 > gen2: |
| 470 | return 1 |
| 471 | case gen1 < gen2: |
| 472 | return -1 |
| 473 | case sha1 > sha2: |
| 474 | return 1 |
| 475 | case sha1 < sha2: |
| 476 | return -1 |
| 477 | } |
| 478 | return 0 |
| 479 | } |
| 480 | |
| 481 | // StripInternalProperties returns a copy of the given body with all internal underscore-prefixed keys removed, except _attachments and _deleted. |
| 482 | func StripInternalProperties(b Body) (Body, bool) { |