Skip to content

Commit 2e2f250

Browse files
committed
api: update safety handling of constant string index
1 parent 38de3b5 commit 2e2f250

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

api/str.hpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -40,22 +40,16 @@ class __jule_Str
4040
// Returns element by index.
4141
// Includes safety checking.
4242
// Designed for constant strings.
43-
static __jule_U8 at(
44-
#ifndef __JULE_ENABLE__PRODUCTION
45-
const char *file,
46-
#endif
47-
const __jule_U8 *s, const __jule_Int n, const __jule_Int i) noexcept
43+
static __jule_U8 at(const char *file, const __jule_U8 *s, const __jule_Int n, const __jule_Int i) noexcept
4844
{
4945
#ifndef __JULE_DISABLE__SAFETY
5046
if (n == 0 || i < 0 || n <= i)
5147
{
5248
__jule_Str error;
5349
__JULE_WRITE_ERROR_INDEX_OUT_OF_RANGE(error, i, n);
5450
error += "\nruntime: string indexing with out of range index";
55-
#ifndef __JULE_ENABLE__PRODUCTION
5651
error += "\nfile: ";
5752
error += file;
58-
#endif
5953
__jule_panicStr(error);
6054
}
6155
#endif

0 commit comments

Comments
 (0)