blob: 04c782cb08e6c12b3ec0babc044a7b9bba2b000c (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
|
// Copyright Vespa.ai. Licensed under the terms of the Apache 2.0 license. See LICENSE in the project root.
#pragma once
namespace juniper
{
template <typename T>
int strncmp(const T* s1, const T* s2, size_t n)
{
size_t i = 0;
for (; i < n; i++)
if (s1[i] != s2[i]) break;
if (i == n) return 0;
return (int)s1[i] - (int)s2[i];
}
} // end namespace juniper
|