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
2bb5030f
Commit
2bb5030f
authored
Sep 01, 2019
by
Max Kellermann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
db/update/Queue: add `noexcept`
parent
366de877
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
Queue.cxx
src/db/update/Queue.cxx
+4
-4
Queue.hxx
src/db/update/Queue.hxx
+9
-9
No files found.
src/db/update/Queue.cxx
View file @
2bb5030f
...
...
@@ -21,7 +21,7 @@
bool
UpdateQueue
::
Push
(
SimpleDatabase
&
db
,
Storage
&
storage
,
const
char
*
path
,
bool
discard
,
unsigned
id
)
const
char
*
path
,
bool
discard
,
unsigned
id
)
noexcept
{
if
(
update_queue
.
size
()
>=
MAX_UPDATE_QUEUE_SIZE
)
return
false
;
...
...
@@ -31,7 +31,7 @@ UpdateQueue::Push(SimpleDatabase &db, Storage &storage,
}
UpdateQueueItem
UpdateQueue
::
Pop
()
UpdateQueue
::
Pop
()
noexcept
{
if
(
update_queue
.
empty
())
return
UpdateQueueItem
();
...
...
@@ -42,7 +42,7 @@ UpdateQueue::Pop()
}
void
UpdateQueue
::
Erase
(
SimpleDatabase
&
db
)
UpdateQueue
::
Erase
(
SimpleDatabase
&
db
)
noexcept
{
for
(
auto
i
=
update_queue
.
begin
(),
end
=
update_queue
.
end
();
i
!=
end
;)
{
...
...
@@ -54,7 +54,7 @@ UpdateQueue::Erase(SimpleDatabase &db)
}
void
UpdateQueue
::
Erase
(
Storage
&
storage
)
UpdateQueue
::
Erase
(
Storage
&
storage
)
noexcept
{
for
(
auto
i
=
update_queue
.
begin
(),
end
=
update_queue
.
end
();
i
!=
end
;)
{
...
...
src/db/update/Queue.hxx
View file @
2bb5030f
...
...
@@ -36,20 +36,20 @@ struct UpdateQueueItem {
unsigned
id
;
bool
discard
;
UpdateQueueItem
()
:
id
(
0
)
{}
UpdateQueueItem
()
noexcept
:
id
(
0
)
{}
UpdateQueueItem
(
SimpleDatabase
&
_db
,
Storage
&
_storage
,
const
char
*
_path
,
bool
_discard
,
unsigned
_id
)
unsigned
_id
)
noexcept
:
db
(
&
_db
),
storage
(
&
_storage
),
path_utf8
(
_path
),
id
(
_id
),
discard
(
_discard
)
{}
bool
IsDefined
()
const
{
bool
IsDefined
()
const
noexcept
{
return
id
!=
0
;
}
void
Clear
()
{
void
Clear
()
noexcept
{
id
=
0
;
}
};
...
...
@@ -62,19 +62,19 @@ class UpdateQueue {
public
:
gcc_nonnull_all
bool
Push
(
SimpleDatabase
&
db
,
Storage
&
storage
,
const
char
*
path
,
bool
discard
,
unsigned
id
);
const
char
*
path
,
bool
discard
,
unsigned
id
)
noexcept
;
UpdateQueueItem
Pop
();
UpdateQueueItem
Pop
()
noexcept
;
void
Clear
()
{
void
Clear
()
noexcept
{
update_queue
.
clear
();
}
gcc_nonnull_all
void
Erase
(
SimpleDatabase
&
db
);
void
Erase
(
SimpleDatabase
&
db
)
noexcept
;
gcc_nonnull_all
void
Erase
(
Storage
&
storage
);
void
Erase
(
Storage
&
storage
)
noexcept
;
};
#endif
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