Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
macaon
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Franck Dary
macaon
Commits
b2f655e3
Commit
b2f655e3
authored
4 years ago
by
Franck Dary
Browse files
Options
Downloads
Patches
Plain Diff
Added const qualifier to operator ==
parent
f06350c6
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
common/include/utf8string.hpp
+4
-4
4 additions, 4 deletions
common/include/utf8string.hpp
common/src/utf8string.cpp
+4
-4
4 additions, 4 deletions
common/src/utf8string.cpp
with
8 additions
and
8 deletions
common/include/utf8string.hpp
+
4
−
4
View file @
b2f655e3
...
...
@@ -18,9 +18,9 @@ class utf8char : public std::array<char, 4>
utf8char
(
const
char
*
other
);
utf8char
&
operator
=
(
char
other
);
utf8char
&
operator
=
(
const
std
::
string
&
other
);
bool
operator
==
(
char
other
);
bool
operator
==
(
const
std
::
string
&
other
);
bool
operator
!=
(
char
other
);
bool
operator
==
(
char
other
)
const
;
bool
operator
==
(
const
std
::
string
&
other
)
const
;
bool
operator
!=
(
char
other
)
const
;
};
class
utf8string
:
public
std
::
vector
<
utf8char
>
...
...
@@ -30,7 +30,7 @@ class utf8string : public std::vector<utf8char>
utf8string
&
operator
=
(
const
std
::
string
&
other
);
utf8string
&
operator
=
(
const
char
*
const
other
);
bool
operator
==
(
const
std
::
string
&
other
);
bool
operator
==
(
const
std
::
string
&
other
)
const
;
void
replace
(
utf8char
from
,
utf8char
to
);
};
...
...
This diff is collapsed.
Click to expand it.
common/src/utf8string.cpp
+
4
−
4
View file @
b2f655e3
...
...
@@ -31,7 +31,7 @@ util::utf8char & util::utf8char::operator=(const std::string & other)
return
*
this
=
splited
[
0
];
}
bool
util
::
utf8char
::
operator
==
(
const
std
::
string
&
other
)
bool
util
::
utf8char
::
operator
==
(
const
std
::
string
&
other
)
const
{
auto
splited
=
splitAsUtf8
(
other
);
if
(
splited
.
size
()
>
1
)
...
...
@@ -39,12 +39,12 @@ bool util::utf8char::operator==(const std::string & other)
return
*
this
==
splited
[
0
];
}
bool
util
::
utf8char
::
operator
==
(
char
other
)
bool
util
::
utf8char
::
operator
==
(
char
other
)
const
{
return
(
*
this
)[
0
]
==
other
&&
!
(
*
this
)[
1
]
&&
!
(
*
this
)[
2
]
&&
!
(
*
this
)[
3
];
}
bool
util
::
utf8char
::
operator
!=
(
char
other
)
bool
util
::
utf8char
::
operator
!=
(
char
other
)
const
{
return
!
(
*
this
==
other
);
}
...
...
@@ -63,7 +63,7 @@ util::utf8string & util::utf8string::operator=(const char * const other)
return
operator
=
(
std
::
string
(
other
));
}
bool
util
::
utf8string
::
operator
==
(
const
std
::
string
&
other
)
bool
util
::
utf8string
::
operator
==
(
const
std
::
string
&
other
)
const
{
if
(
size
()
!=
other
.
size
())
return
false
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment