mirror of
https://github.com/tezc/sc.git
synced 2025-01-28 07:03:06 +08:00
Merge pull request #43 from tezc/string-perf
Minor string trim fix, minor doc change
This commit is contained in:
commit
ed5bcab2b9
@ -8,7 +8,6 @@ There is no build, copy .h .c files you want.
|
|||||||
Libraries are portable, see [test](#test) section for details.
|
Libraries are portable, see [test](#test) section for details.
|
||||||
|
|
||||||
As a general rule, all libraries report errors back to users (e.g out of memory).
|
As a general rule, all libraries report errors back to users (e.g out of memory).
|
||||||
If a library uses heap memory, you can plug your allocator.
|
|
||||||
|
|
||||||
### List
|
### List
|
||||||
|
|
||||||
@ -29,7 +28,7 @@ If a library uses heap memory, you can plug your allocator.
|
|||||||
| **[perf](perf)** | Benchmark utility to get performance counters info via perf_event_open() |
|
| **[perf](perf)** | Benchmark utility to get performance counters info via perf_event_open() |
|
||||||
| **[queue](queue)** | Generic queue which can be used as dequeue/stack/list as well |
|
| **[queue](queue)** | Generic queue which can be used as dequeue/stack/list as well |
|
||||||
| **[sc](sc)** | Utility functions |
|
| **[sc](sc)** | Utility functions |
|
||||||
| **[signal](signal)** | Signal handler & signal safe snprintf (handling CTRL+C, printing backtrace on crash etc) |
|
| **[signal](signal)** | Signal safe snprintf & Signal handler (handling CTRL+C, printing backtrace on crash etc) |
|
||||||
| **[socket](socket)** | Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows |
|
| **[socket](socket)** | Pipe / tcp sockets(also unix domain sockets) /Epoll/Kqueue/WSAPoll for Posix and Windows |
|
||||||
| **[string](string)** | Length prefixed, null terminated C strings. |
|
| **[string](string)** | Length prefixed, null terminated C strings. |
|
||||||
| **[thread](thread)** | Thread wrapper for Posix and Windows. |
|
| **[thread](thread)** | Thread wrapper for Posix and Windows. |
|
||||||
|
@ -283,7 +283,7 @@ bool sc_str_trim(char **str, const char *list)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = strlen(*str);
|
len = sc_str_meta(*str)->len;
|
||||||
start = *str + strspn(*str, list);
|
start = *str + strspn(*str, list);
|
||||||
end = (*str) + len;
|
end = (*str) + len;
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user