From 1b7372f2fb55f704b885e1097e2ec0381068c855 Mon Sep 17 00:00:00 2001 From: Ben Noordhuis Date: Tue, 25 Jul 2017 12:20:40 +0200 Subject: src: replace ASSERT with CHECK MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Builds always have asserts enabled so there is no point distinguishing between debug-only checks and run-time checks. Replace calls to ASSERT and friends with their CHECK counterparts. Fixes: https://github.com/nodejs/node/issues/14461 PR-URL: https://github.com/nodejs/node/pull/14474 Reviewed-By: Colin Ihrig Reviewed-By: James M Snell Reviewed-By: Michaƫl Zasso Reviewed-By: Nikolai Vavilov Reviewed-By: XadillaX --- src/string_search.h | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/string_search.h') diff --git a/src/string_search.h b/src/string_search.h index 6040888110..dfdb8e9a16 100644 --- a/src/string_search.h +++ b/src/string_search.h @@ -28,7 +28,7 @@ class Vector { public: Vector(T* data, size_t length, bool isForward) : start_(data), length_(length), is_forward_(isForward) { - ASSERT(length > 0 && data != nullptr); + CHECK(length > 0 && data != nullptr); } // Returns the start of the memory range. @@ -44,7 +44,7 @@ class Vector { // Access individual vector elements - checks bounds in debug mode. T& operator[](size_t index) const { - ASSERT(index < length_); + CHECK(index < length_); return start_[is_forward_ ? index : (length_ - index - 1)]; } @@ -342,7 +342,7 @@ size_t StringSearch::LinearSearch( i = FindFirstCharacter(pattern, subject, i); if (i == subject.length()) return subject.length(); - ASSERT_LE(i, n); + CHECK_LE(i, n); bool matches = true; for (size_t j = 1; j < pattern_length; j++) { @@ -591,7 +591,7 @@ size_t StringSearch::InitialSearch( i = FindFirstCharacter(pattern, subject, i); if (i == subject.length()) return subject.length(); - ASSERT_LE(i, n); + CHECK_LE(i, n); size_t j = 1; do { if (pattern[j] != subject[i + j]) { @@ -644,7 +644,7 @@ size_t SearchString(const Char* haystack, needle, needle_length, is_forward); Vector v_haystack = Vector( haystack, haystack_length, is_forward); - ASSERT(haystack_length >= needle_length); + CHECK(haystack_length >= needle_length); size_t diff = haystack_length - needle_length; size_t relative_start_index; if (is_forward) { -- cgit v1.2.3