Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
M
mpd
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Иван Мажукин
mpd
Commits
3bc45fbf
You need to sign in or sign up before continuing.
Commit
3bc45fbf
authored
4 years ago
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/AllocatedString: remove Null(), IsNull()
parent
36168a24
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
5 additions
and
13 deletions
+5
-13
NarrowPath.cxx
src/fs/NarrowPath.cxx
+1
-1
Compare.cxx
src/lib/icu/Compare.cxx
+2
-2
Compare.hxx
src/lib/icu/Compare.hxx
+1
-1
IcyMetaDataServer.cxx
src/output/plugins/httpd/IcyMetaDataServer.cxx
+1
-1
AllocatedString.hxx
src/util/AllocatedString.hxx
+0
-8
No files found.
src/fs/NarrowPath.cxx
View file @
3bc45fbf
...
...
@@ -29,7 +29,7 @@
NarrowPath
::
NarrowPath
(
Path
_path
)
noexcept
:
value
(
WideCharToMultiByte
(
CP_ACP
,
_path
.
c_str
()))
{
if
(
value
.
IsNull
()
)
if
(
value
==
nullptr
)
/* fall back to empty string */
value
=
Value
::
Empty
();
}
...
...
This diff is collapsed.
Click to expand it.
src/lib/icu/Compare.cxx
View file @
3bc45fbf
...
...
@@ -56,7 +56,7 @@ IcuCompare::operator==(const char *haystack) const noexcept
#ifdef HAVE_ICU_CASE_FOLD
return
StringIsEqual
(
IcuCaseFold
(
haystack
).
c_str
(),
needle
.
c_str
());
#elif defined(_WIN32)
if
(
needle
.
IsNull
()
)
if
(
needle
==
nullptr
)
/* the MultiByteToWideChar() call in the constructor
has failed, so let's always fail the comparison */
return
false
;
...
...
@@ -83,7 +83,7 @@ IcuCompare::IsIn(const char *haystack) const noexcept
return
StringFind
(
IcuCaseFold
(
haystack
).
c_str
(),
needle
.
c_str
())
!=
nullptr
;
#elif defined(_WIN32)
if
(
needle
.
IsNull
()
)
if
(
needle
==
nullptr
)
/* the MultiByteToWideChar() call in the constructor
has failed, so let's always fail the comparison */
return
false
;
...
...
This diff is collapsed.
Click to expand it.
src/lib/icu/Compare.hxx
View file @
3bc45fbf
...
...
@@ -65,7 +65,7 @@ public:
gcc_pure
operator
bool
()
const
noexcept
{
return
!
needle
.
IsNull
()
;
return
needle
!=
nullptr
;
}
gcc_pure
...
...
This diff is collapsed.
Click to expand it.
src/output/plugins/httpd/IcyMetaDataServer.cxx
View file @
3bc45fbf
...
...
@@ -110,7 +110,7 @@ icy_server_metadata_page(const Tag &tag, const TagType *types) noexcept
const
auto
icy_string
=
icy_server_metadata_string
(
stream_title
,
""
);
if
(
icy_string
.
IsNull
()
)
if
(
icy_string
==
nullptr
)
return
nullptr
;
return
std
::
make_shared
<
Page
>
(
icy_string
.
c_str
(),
...
...
This diff is collapsed.
Click to expand it.
src/util/AllocatedString.hxx
View file @
3bc45fbf
...
...
@@ -85,10 +85,6 @@ public:
return
BasicAllocatedString
(
value
);
}
static
BasicAllocatedString
Null
()
noexcept
{
return
nullptr
;
}
static
BasicAllocatedString
Empty
()
{
auto
p
=
new
value_type
[
1
];
p
[
0
]
=
SENTINEL
;
...
...
@@ -120,10 +116,6 @@ public:
return
value
!=
nullptr
;
}
constexpr
bool
IsNull
()
const
noexcept
{
return
value
==
nullptr
;
}
operator
string_view
()
const
noexcept
{
return
value
!=
nullptr
?
string_view
(
value
)
...
...
This diff is collapsed.
Click to expand it.
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