一些基础组件
This commit is contained in:
@@ -37,11 +37,13 @@ c_err_t c_StringList_Clone(c_StringList* dest, const c_StringList* src);
|
|||||||
c_err_t c_StringList_Deduplicate(c_StringList* self);
|
c_err_t c_StringList_Deduplicate(c_StringList* self);
|
||||||
|
|
||||||
// 极致高频内联只读窥探接口
|
// 极致高频内联只读窥探接口
|
||||||
C_STATIC_FORCE_INLINE c_size_t c_StringList_Size(const c_StringList* self) {
|
C_STATIC_FORCE_INLINE
|
||||||
|
c_size_t c_StringList_Size(const c_StringList* self) {
|
||||||
return self ? self->size : 0; // O(1) 实时读取
|
return self ? self->size : 0; // O(1) 实时读取
|
||||||
}
|
}
|
||||||
|
|
||||||
C_STATIC_FORCE_INLINE const char* c_StringList_Get(const c_StringList* self, c_size_t index) {
|
C_STATIC_FORCE_INLINE
|
||||||
|
const char* c_StringList_Get(const c_StringList* self, c_size_t index) {
|
||||||
if (!self || index >= self->size || !self->strings) return NULL;
|
if (!self || index >= self->size || !self->strings) return NULL;
|
||||||
return self->strings[index]; // 零拷贝原位返回
|
return self->strings[index]; // 零拷贝原位返回
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user