]> git.tdb.fi Git - libs/core.git/blob - source/stringcodec/codecutils.cpp
Remove deprecated things
[libs/core.git] / source / stringcodec / codecutils.cpp
1 #include "codecutils.h"
2
3 namespace Msp {
4 namespace StringCodec {
5
6 int transform_mapping_or_direct(const int *mapping, unsigned map_size, int ch, bool reverse)
7 {
8         for(unsigned i=0; i<map_size*2; i+=2)
9         {
10                 if(mapping[i+reverse]==ch)
11                         return mapping[i+1-reverse];
12                 else if(mapping[i+1-reverse]==ch)
13                         return -1;
14         }
15
16         return ch;
17 }
18
19 } // namespace StringCodec
20 } // namespace Msp