mirror of
https://github.com/matrix-construct/construct
synced 2024-11-26 00:32:35 +01:00
ircd::fs: Minor cleanup.
This commit is contained in:
parent
5c558f98b6
commit
a1863ba3b2
1 changed files with 6 additions and 4 deletions
10
ircd/fs.cc
10
ircd/fs.cc
|
@ -2013,11 +2013,13 @@ ircd::fs::debug_paths()
|
||||||
const char *
|
const char *
|
||||||
ircd::fs::path_str(const string_view &s)
|
ircd::fs::path_str(const string_view &s)
|
||||||
{
|
{
|
||||||
static const size_t buf_sz{PATH_MAX_LEN}, buf_cnt{4};
|
static const size_t sz{PATH_MAX_LEN}, cnt{8};
|
||||||
thread_local char buf[buf_cnt][buf_sz];
|
thread_local char buffer[cnt][sz];
|
||||||
thread_local size_t i{0};
|
thread_local size_t i{0};
|
||||||
|
auto &buf(buffer[i]);
|
||||||
return data(strlcpy(buf[i++ % buf_cnt], s));
|
++i %= cnt;
|
||||||
|
strlcpy(buf, s);
|
||||||
|
return buf;
|
||||||
}
|
}
|
||||||
|
|
||||||
uint
|
uint
|
||||||
|
|
Loading…
Reference in a new issue