Browse Source

Make pretty function work again.

RLP can use unordered_sets.
cl-refactor
Gav Wood 10 years ago
parent
commit
a7cd6c5173
  1. 8
      libdevcore/Common.h
  2. 18
      libdevcore/RLP.h

8
libdevcore/Common.h

@ -218,17 +218,17 @@ private:
#define DEV_TIMED(S) for (::std::pair<::dev::TimerHelper, bool> __eth_t(S, true); __eth_t.second; __eth_t.second = false)
#define DEV_TIMED_SCOPE(S) ::dev::TimerHelper __eth_t(S)
#if WIN32
#define DEV_TIMED_FUNCTION DEV_TIMED_SCOPE(DEV_QUOTED(__FUNCSIG__))
#define DEV_TIMED_FUNCTION DEV_TIMED_SCOPE(__FUNCSIG__)
#else
#define DEV_TIMED_FUNCTION DEV_TIMED_SCOPE(DEV_QUOTED(__PRETTY_FUNCTION__))
#define DEV_TIMED_FUNCTION DEV_TIMED_SCOPE(__PRETTY_FUNCTION__)
#endif
#define DEV_TIMED_ABOVE(S, MS) for (::std::pair<::dev::TimerHelper, bool> __eth_t(::dev::TimerHelper(S, MS), true); __eth_t.second; __eth_t.second = false)
#define DEV_TIMED_SCOPE_ABOVE(S, MS) ::dev::TimerHelper __eth_t(S, MS)
#if WIN32
#define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(DEV_QUOTED(__FUNCSIG__), MS)
#define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(__FUNCSIG__, MS)
#else
#define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(DEV_QUOTED(__PRETTY_FUNCTION__), MS)
#define DEV_TIMED_FUNCTION_ABOVE(MS) DEV_TIMED_SCOPE_ABOVE(__PRETTY_FUNCTION__, MS)
#endif
enum class WithExisting: int

18
libdevcore/RLP.h

@ -204,9 +204,7 @@ public:
{
ret.reserve(itemCount());
for (auto const& i: *this)
{
ret.push_back((T)i);
}
}
return ret;
}
@ -216,15 +214,21 @@ public:
{
std::set<T> ret;
if (isList())
{
for (auto const& i: *this)
{
ret.insert((T)i);
}
}
return ret;
}
template <class T>
std::unordered_set<T> toUnorderedSet() const
{
std::unordered_set<T> ret;
if (isList())
for (auto const& i: *this)
ret.insert((T)i);
return ret;
}
template <class T, class U>
std::pair<T, U> toPair() const
{

Loading…
Cancel
Save