Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Gauthier Quesnel
irritator
Commits
a91f2c26
Commit
a91f2c26
authored
Apr 21, 2020
by
Gauthier Quesnel
Browse files
core: fix small-string capacity
parent
243162a7
Changes
1
Hide whitespace changes
Inline
Side-by-side
lib/include/irritator/core.hpp
View file @
a91f2c26
...
...
@@ -317,10 +317,8 @@ public:
constexpr
void
size
(
std
::
size_t
sz
)
noexcept
{
if
(
sz
<=
capacity
())
{
buffer_
[
sz
]
=
'\0'
;
size_
=
static_cast
<
u8
>
(
sz
);
}
size_
=
static_cast
<
u8
>
(
std
::
min
(
sz
,
length
-
1
));
buffer_
[
size_
]
=
'\0'
;
}
constexpr
std
::
size_t
size
()
const
noexcept
...
...
@@ -330,7 +328,7 @@ public:
constexpr
std
::
size_t
capacity
()
const
noexcept
{
return
length
-
1
;
return
length
;
}
constexpr
void
assign
(
const
std
::
string_view
str
)
noexcept
...
...
@@ -4863,7 +4861,7 @@ public:
{
const
auto
end
=
std
::
end
(
dst_port
->
connections
);
auto
it
=
std
::
begin
(
dst_port
->
connections
);
auto
it
=
std
::
begin
(
dst_port
->
connections
);
if
(
*
it
==
src
)
{
dst_port
->
connections
.
pop_front
();
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment