MCPcopy Create free account
hub / github.com/creatale/node-dv / sarrayUnionByAset

Function sarrayUnionByAset

deps/leptonica/src/sarray2.c:236–257  ·  view source on GitHub ↗

----------------------------------------------------------------------* * 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

Source from the content-addressed store, hash-verified

234 * </pre>
235 */
236SARRAY *
237sarrayUnionByAset(SARRAY *sa1,
238 SARRAY *sa2)
239{
240SARRAY *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/*!

Callers

nothing calls this directly

Calls 4

sarrayCopyFunction · 0.85
sarrayJoinFunction · 0.85
sarrayRemoveDupsByAsetFunction · 0.85
sarrayDestroyFunction · 0.85

Tested by

no test coverage detected