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
LimaGroup
Lima-camera-eiger
Commits
bea10165
Commit
bea10165
authored
Feb 14, 2020
by
Alejandro Homs Puron
Browse files
Use more efficient unique_ptr for CurlLoop::ActiveCurlRequest
parent
eb1f4462
Changes
2
Hide whitespace changes
Inline
Side-by-side
sdk/linux/EigerAPI/include/eigerapi/CurlLoop.h
View file @
bea10165
...
...
@@ -91,7 +91,7 @@ namespace eigerapi
private:
struct
ActiveCurlRequest
;
typedef
std
::
shared_ptr
<
ActiveCurlRequest
>
ActReq
;
typedef
std
::
unique_ptr
<
const
ActiveCurlRequest
>
ActReq
;
typedef
std
::
map
<
CURL
*
,
ActReq
>
MapRequests
;
typedef
std
::
list
<
CurlReq
>
ListRequests
;
static
void
*
_runFunc
(
void
*
);
...
...
sdk/linux/EigerAPI/src/CurlLoop.cpp
View file @
bea10165
...
...
@@ -300,9 +300,9 @@ inline void CurlLoop::_check_new_requests()
{
const
CurlReq
&
req
=
*
i
;
ActReq
act_req
(
new
ActiveCurlRequest
(
req
,
m_multi_handle
));
MapRequests
::
value_type
map_value
(
req
->
get_handle
(),
act_req
);
MapRequests
::
value_type
map_value
(
req
->
get_handle
(),
std
::
move
(
act_req
)
)
;
typedef
std
::
pair
<
MapRequests
::
iterator
,
bool
>
InsertResult
;
InsertResult
result
=
m_pending_requests
.
insert
(
map_value
);
InsertResult
result
=
m_pending_requests
.
insert
(
std
::
move
(
map_value
)
)
;
if
(
!
result
.
second
)
THROW_EIGER_EXCEPTION
(
"CurlLoop::_check_new_requests"
,
"handle found in pending requests"
);
...
...
@@ -425,5 +425,3 @@ void CurlLoop::_run()
//cleanup
m_pending_requests
.
clear
();
}
Write
Preview
Supports
Markdown
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