Esempio n. 1
0
        public static int CompareString(StackValue s1, StackValue s2, RuntimeCore runtimeCore)
        {
            if (!s1.IsString || !s2.IsString)
                return Constants.kInvalidIndex;

            if (s1.Equals(s2))
                return 0;

            string str1 = runtimeCore.RuntimeMemory.Heap.ToHeapObject<DSString>(s1).Value;
            string str2 = runtimeCore.RuntimeMemory.Heap.ToHeapObject<DSString>(s2).Value;
            return string.Compare(str1, str2);
        }
Esempio n. 2
0
        public static int CompareString(StackValue s1, StackValue s2, Core core)
        {
            if (!s1.IsString || !s2.IsString)
            {
                return(Constants.kInvalidIndex);
            }

            if (s1.Equals(s2))
            {
                return(0);
            }

            string str1 = core.Heap.GetString(s1);
            string str2 = core.Heap.GetString(s2);

            return(string.Compare(str1, str2));
        }