----------------------------------------------------------------------* * Set operations using aset (rbtree) * *----------------------------------------------------------------------*/ ! * \brief sarrayUnionByAset() * * \param[in] sa1, sa2 * \return sad with the union of the string set, or NULL on error * * * Notes: * (1) Duplicates are
| 234 | * </pre> |
| 235 | */ |
| 236 | SARRAY * |
| 237 | sarrayUnionByAset(SARRAY *sa1, |
| 238 | SARRAY *sa2) |
| 239 | { |
| 240 | SARRAY *sa3, *sad; |
| 241 | |
| 242 | PROCNAME("sarrayUnionByAset"); |
| 243 | |
| 244 | if (!sa1) |
| 245 | return (SARRAY *)ERROR_PTR("sa1 not defined", procName, NULL); |
| 246 | if (!sa2) |
| 247 | return (SARRAY *)ERROR_PTR("sa2 not defined", procName, NULL); |
| 248 | |
| 249 | /* Join */ |
| 250 | sa3 = sarrayCopy(sa1); |
| 251 | sarrayJoin(sa3, sa2); |
| 252 | |
| 253 | /* Eliminate duplicates */ |
| 254 | sad = sarrayRemoveDupsByAset(sa3); |
| 255 | sarrayDestroy(&sa3); |
| 256 | return sad; |
| 257 | } |
| 258 | |
| 259 | |
| 260 | /*! |
nothing calls this directly
no test coverage detected