summaryrefslogtreecommitdiff
path: root/src/strutil.h
blob: c9c6caa563c4434e09225bdfd68488da70ceec5d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// Copyright 2011 Google Inc. All Rights Reserved.

#ifndef ART_SRC_STRUTIL_H_
#define ART_SRC_STRUTIL_H_

#include <string.h>

namespace art {

// Key comparison function for C strings.
struct CStringLt {
  bool operator()(const char* s1, const char* s2) const {
    return strcmp(s1, s2) < 0;
  }
};

// Key equality function for C strings.
struct CStringEq {
  bool operator()(const char* s1, const char* s2) const {
    return strcmp(s1, s2) == 0;
  }
};

}  // namespace art

#endif  // ART_SRC_STRUTIL_H_