mirror of
https://github.com/status-im/contracts.git
synced 2025-02-24 12:38:49 +00:00
add findemojirangepos and changed constants to views
This commit is contained in:
parent
b5f21fe5f8
commit
76ccdb32b3
@ -51,7 +51,7 @@ contract EmojiCheck is Controlled {
|
||||
uint256[] _rangePos
|
||||
)
|
||||
public
|
||||
constant
|
||||
view
|
||||
returns(bool)
|
||||
{
|
||||
uint len = _s.length;
|
||||
@ -64,7 +64,25 @@ contract EmojiCheck is Controlled {
|
||||
return true;
|
||||
}
|
||||
|
||||
function isEmoji(uint32 _char) public constant returns(bool) {
|
||||
function findEmojiRangePosition(uint32 _char)
|
||||
public
|
||||
view
|
||||
returns(uint256 rangePos)
|
||||
{
|
||||
uint len = ranges.length;
|
||||
for (uint256 i = 0; i < len; i++) {
|
||||
if (isInEmojiRange(_char, i)) {
|
||||
return i;
|
||||
}
|
||||
}
|
||||
revert();
|
||||
}
|
||||
|
||||
function isEmoji(uint32 _char)
|
||||
public
|
||||
view
|
||||
returns(bool)
|
||||
{
|
||||
uint len = ranges.length;
|
||||
for (uint256 i = 0; i < len; i++) {
|
||||
if (isInEmojiRange(_char, i)) {
|
||||
@ -78,7 +96,7 @@ contract EmojiCheck is Controlled {
|
||||
uint32[] _s
|
||||
)
|
||||
public
|
||||
constant
|
||||
view
|
||||
returns(bool)
|
||||
{
|
||||
uint len = _s.length;
|
||||
|
Loading…
x
Reference in New Issue
Block a user