Bug 827234 - Move Swap to js/public/Utility from js/src/jsutil.h. r=terrence

This commit is contained in:
Justin Lebar 2013-01-08 11:04:19 +01:00
parent 2c9102279d
commit afdc381a5c
2 changed files with 9 additions and 9 deletions

View File

@ -709,6 +709,15 @@ class ReentrancyGuard
}
};
template <class T>
JS_ALWAYS_INLINE static void
Swap(T &t, T &u)
{
T tmp(Move(t));
t = Move(u);
u = Move(tmp);
}
/*
* Round x up to the nearest power of 2. This function assumes that the most
* significant bit of x is not set, which would lead to overflow.

View File

@ -257,15 +257,6 @@ PodEqual(T *one, T *two, size_t len)
return !memcmp(one, two, len * sizeof(T));
}
template <class T>
JS_ALWAYS_INLINE static void
Swap(T &t, T &u)
{
T tmp(Move(t));
t = Move(u);
u = Move(tmp);
}
template <typename T>
static inline bool
IsPowerOfTwo(T t)