* xmlXPtrLocationSetMerge: * @val1: the first LocationSet * @val2: the second LocationSet * * Merges two rangesets, all ranges from @val2 are added to @val1 * * Returns val1 once extended or NULL in case of error. */
| 658 | * Returns val1 once extended or NULL in case of error. |
| 659 | */ |
| 660 | xmlLocationSetPtr |
| 661 | xmlXPtrLocationSetMerge(xmlLocationSetPtr val1, xmlLocationSetPtr val2) { |
| 662 | int i; |
| 663 | |
| 664 | if (val1 == NULL) return(NULL); |
| 665 | if (val2 == NULL) return(val1); |
| 666 | |
| 667 | /* |
| 668 | * !!!!! this can be optimized a lot, knowing that both |
| 669 | * val1 and val2 already have unicity of their values. |
| 670 | */ |
| 671 | |
| 672 | for (i = 0;i < val2->locNr;i++) |
| 673 | xmlXPtrLocationSetAdd(val1, val2->locTab[i]); |
| 674 | |
| 675 | return(val1); |
| 676 | } |
| 677 | |
| 678 | /** |
| 679 | * xmlXPtrLocationSetDel: |
nothing calls this directly
no test coverage detected