Skip to content

Commit 90f6ef0

Browse files
authored
Merge pull request #474 from rdkcentral/development/R2-fixes
[ENHANCEMENTS] Move constructor for the Com::Iterator. Removed a chec…
2 parents 98e4890 + 1fb1a15 commit 90f6ef0

File tree

2 files changed

+12
-7
lines changed

2 files changed

+12
-7
lines changed

Source/com/IRPCIterator.h

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,19 @@ namespace RPC {
4545
/* @stubgen:skip */
4646
template<typename INTERFACE>
4747
class IteratorType : public INTERFACE {
48-
private:
48+
public:
49+
using Container = typename std::list<typename INTERFACE::Element>;
50+
4951
IteratorType() = delete;
5052
IteratorType(const IteratorType&) = delete;
5153
IteratorType& operator=(const IteratorType&) = delete;
5254

53-
public:
55+
explicit IteratorType(Container&& container)
56+
: _container(std::forward(container))
57+
, _index(0)
58+
{
59+
_iterator = _container.begin();
60+
}
5461
template <typename CONTAINER, typename PREDICATE>
5562
IteratorType(const CONTAINER& container, PREDICATE predicate)
5663
: _container()
@@ -185,8 +192,8 @@ namespace RPC {
185192
END_INTERFACE_MAP
186193

187194
private:
188-
typename std::list<typename INTERFACE::Element> _container;
189-
mutable typename std::list<typename INTERFACE::Element>::iterator _iterator;
195+
Container _container;
196+
mutable typename Container::iterator _iterator;
190197
mutable uint32_t _index;
191198
};
192199
}

Source/core/FileSystem.cpp

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -193,9 +193,7 @@ namespace Core {
193193
if (result[length - 1] != '/')
194194
#endif
195195
{
196-
if (Core::File(location).IsDirectory() == true) {
197-
result += '/';
198-
}
196+
result += '/';
199197
}
200198
}
201199
return (result);

0 commit comments

Comments
 (0)