File tree Expand file tree Collapse file tree 1 file changed +21
-2
lines changed
Expand file tree Collapse file tree 1 file changed +21
-2
lines changed Original file line number Diff line number Diff line change 88 * | Mikachu2333 <[email protected] > 99 * |
1010 * Created On : <2023-08-28>
11- * Last Modified : <2025-08-21 >
11+ * Last Modified : <2025-08-22 >
1212 *
1313 *
1414 * xy: 襄阳、咸阳
2222#ifndef XY_H
2323#define XY_H
2424
25- #define _XY_Version "v0.1.7.0-2025/08/21 "
25+ #define _XY_Version "v0.1.7.0-2025/08/22 "
2626#define _XY_Maintain_URL "https://github.com/RubyMetric/chsrc/blob/dev/lib/xy.h"
2727#define _XY_Maintain_URL2 "https://gitee.com/RubyMetric/chsrc/blob/dev/lib/xy.h"
2828
@@ -1367,6 +1367,25 @@ xy_seq_each (XySeq_t *seq, void (*func)(void *))
13671367 }
13681368}
13691369
1370+ /**
1371+ * @flavor Ruby: Enumerable#find
1372+ */
1373+ void *
1374+ xy_seq_find (XySeq_t * seq , bool (* func )(void * ))
1375+ {
1376+ xy_cant_be_null (seq );
1377+ xy_cant_be_null (func );
1378+
1379+ for (XySeqItem_t * it = seq -> first_item ; it ; it = it -> next )
1380+ {
1381+ if (func (it -> data ))
1382+ {
1383+ return it -> data ;
1384+ }
1385+ }
1386+ return NULL ;
1387+ }
1388+
13701389
13711390
13721391#define _XY_Map_Buckets_Count 97
You can’t perform that action at this time.
0 commit comments