File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff line change @@ -902,17 +902,14 @@ ConnectionPool::ConnectionHandle ConnectionPool::SpecificPool::tryGetConnection(
902
902
continue ;
903
903
}
904
904
905
- auto connPtr = conn.get ();
906
-
907
- if (lease) {
908
- _leasedPool[connPtr] = std::move (conn);
909
- } else {
910
- _checkedOutPool[connPtr] = std::move (conn);
911
- }
905
+ // Use a reference to the target map location as our connection,
906
+ // so we're not juggling raw pointers any more than we need to.
907
+ OwnedConnection& mappedConn = (lease ? _leasedPool : _checkedOutPool)[conn.get ()];
908
+ mappedConn = std::move (conn);
912
909
913
910
// pass it to the user
914
- connPtr ->resetToUnknown ();
915
- auto handle = makeHandle (connPtr , lease);
911
+ mappedConn ->resetToUnknown ();
912
+ auto handle = makeHandle (mappedConn. get () , lease);
916
913
return handle;
917
914
}
918
915
You can’t perform that action at this time.
0 commit comments