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
Commit
3bc45fbf
authored
Jan 21, 2021
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
util/AllocatedString: remove Null(), IsNull()
parent
36168a24
Hide 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 @@
...
@@ -29,7 +29,7 @@
NarrowPath
::
NarrowPath
(
Path
_path
)
noexcept
NarrowPath
::
NarrowPath
(
Path
_path
)
noexcept
:
value
(
WideCharToMultiByte
(
CP_ACP
,
_path
.
c_str
()))
:
value
(
WideCharToMultiByte
(
CP_ACP
,
_path
.
c_str
()))
{
{
if
(
value
.
IsNull
()
)
if
(
value
==
nullptr
)
/* fall back to empty string */
/* fall back to empty string */
value
=
Value
::
Empty
();
value
=
Value
::
Empty
();
}
}
...
...
src/lib/icu/Compare.cxx
View file @
3bc45fbf
...
@@ -56,7 +56,7 @@ IcuCompare::operator==(const char *haystack) const noexcept
...
@@ -56,7 +56,7 @@ IcuCompare::operator==(const char *haystack) const noexcept
#ifdef HAVE_ICU_CASE_FOLD
#ifdef HAVE_ICU_CASE_FOLD
return
StringIsEqual
(
IcuCaseFold
(
haystack
).
c_str
(),
needle
.
c_str
());
return
StringIsEqual
(
IcuCaseFold
(
haystack
).
c_str
(),
needle
.
c_str
());
#elif defined(_WIN32)
#elif defined(_WIN32)
if
(
needle
.
IsNull
()
)
if
(
needle
==
nullptr
)
/* the MultiByteToWideChar() call in the constructor
/* the MultiByteToWideChar() call in the constructor
has failed, so let's always fail the comparison */
has failed, so let's always fail the comparison */
return
false
;
return
false
;
...
@@ -83,7 +83,7 @@ IcuCompare::IsIn(const char *haystack) const noexcept
...
@@ -83,7 +83,7 @@ IcuCompare::IsIn(const char *haystack) const noexcept
return
StringFind
(
IcuCaseFold
(
haystack
).
c_str
(),
return
StringFind
(
IcuCaseFold
(
haystack
).
c_str
(),
needle
.
c_str
())
!=
nullptr
;
needle
.
c_str
())
!=
nullptr
;
#elif defined(_WIN32)
#elif defined(_WIN32)
if
(
needle
.
IsNull
()
)
if
(
needle
==
nullptr
)
/* the MultiByteToWideChar() call in the constructor
/* the MultiByteToWideChar() call in the constructor
has failed, so let's always fail the comparison */
has failed, so let's always fail the comparison */
return
false
;
return
false
;
...
...
src/lib/icu/Compare.hxx
View file @
3bc45fbf
...
@@ -65,7 +65,7 @@ public:
...
@@ -65,7 +65,7 @@ public:
gcc_pure
gcc_pure
operator
bool
()
const
noexcept
{
operator
bool
()
const
noexcept
{
return
!
needle
.
IsNull
()
;
return
needle
!=
nullptr
;
}
}
gcc_pure
gcc_pure
...
...
src/output/plugins/httpd/IcyMetaDataServer.cxx
View file @
3bc45fbf
...
@@ -110,7 +110,7 @@ icy_server_metadata_page(const Tag &tag, const TagType *types) noexcept
...
@@ -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
,
""
);
const
auto
icy_string
=
icy_server_metadata_string
(
stream_title
,
""
);
if
(
icy_string
.
IsNull
()
)
if
(
icy_string
==
nullptr
)
return
nullptr
;
return
nullptr
;
return
std
::
make_shared
<
Page
>
(
icy_string
.
c_str
(),
return
std
::
make_shared
<
Page
>
(
icy_string
.
c_str
(),
...
...
src/util/AllocatedString.hxx
View file @
3bc45fbf
...
@@ -85,10 +85,6 @@ public:
...
@@ -85,10 +85,6 @@ public:
return
BasicAllocatedString
(
value
);
return
BasicAllocatedString
(
value
);
}
}
static
BasicAllocatedString
Null
()
noexcept
{
return
nullptr
;
}
static
BasicAllocatedString
Empty
()
{
static
BasicAllocatedString
Empty
()
{
auto
p
=
new
value_type
[
1
];
auto
p
=
new
value_type
[
1
];
p
[
0
]
=
SENTINEL
;
p
[
0
]
=
SENTINEL
;
...
@@ -120,10 +116,6 @@ public:
...
@@ -120,10 +116,6 @@ public:
return
value
!=
nullptr
;
return
value
!=
nullptr
;
}
}
constexpr
bool
IsNull
()
const
noexcept
{
return
value
==
nullptr
;
}
operator
string_view
()
const
noexcept
{
operator
string_view
()
const
noexcept
{
return
value
!=
nullptr
return
value
!=
nullptr
?
string_view
(
value
)
?
string_view
(
value
)
...
...
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