From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/JavaScriptCore/runtime/MatchResult.h | 24 ++++++++++++++++++------ 1 file changed, 18 insertions(+), 6 deletions(-) (limited to 'Source/JavaScriptCore/runtime/MatchResult.h') diff --git a/Source/JavaScriptCore/runtime/MatchResult.h b/Source/JavaScriptCore/runtime/MatchResult.h index d87c8516b..71291379e 100644 --- a/Source/JavaScriptCore/runtime/MatchResult.h +++ b/Source/JavaScriptCore/runtime/MatchResult.h @@ -1,5 +1,5 @@ /* - * Copyright (C) 2012 Apple Inc. All rights reserved. + * Copyright (C) 2012, 2016 Apple Inc. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -23,12 +23,22 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef MatchResult_h -#define MatchResult_h +#pragma once + +#include +#include // for notFound + +namespace JSC { typedef uint64_t EncodedMatchResult; struct MatchResult { + MatchResult() + : start(WTF::notFound) + , end(0) + { + } + ALWAYS_INLINE MatchResult(size_t start, size_t end) : start(start) , end(end) @@ -51,10 +61,10 @@ struct MatchResult { ALWAYS_INLINE static MatchResult failed() { - return MatchResult(WTF::notFound, 0); + return MatchResult(); } - ALWAYS_INLINE operator bool() + ALWAYS_INLINE explicit operator bool() const { return start != WTF::notFound; } @@ -63,9 +73,11 @@ struct MatchResult { { return start == end; } + + void dump(PrintStream&) const; size_t start; size_t end; }; -#endif +} // namespace JSC -- cgit v1.2.1