Backed out changeset a91ccbe2b3fd (bug 1483449) for failures at nsStaticAtomUtils.h:25. CLOSED TREE

This commit is contained in:
Csoregi Natalia 2018-08-16 05:11:46 +03:00
parent d0fbf8a9e5
commit 22b0dc3451

View File

@ -13,17 +13,15 @@
#include "mozilla/Maybe.h"
// This class holds basic operations on arrays of static atoms.
class nsStaticAtomUtils
{
class nsStaticAtomUtils {
public:
static mozilla::Maybe<uint32_t> Lookup(nsAtom* aAtom,
const nsStaticAtom* aAtoms,
uint32_t aCount)
{
if (aAtom->IsStatic()) {
ptrdiff_t index = aAtom->AsStatic() - aAtoms;
if (index >= 0 && index < aCount) {
return mozilla::Some(static_cast<uint32_t>(index));
for (uint32_t i = 0; i < aCount; i++) {
if (aAtom == &aAtoms[i]) {
return mozilla::Some(i);
}
}
return mozilla::Nothing();