Differences From Artifact [b2cfcd4f85]:
- File src/OFString.m — part of check-in [4bbac7ab17] at 2020-11-01 11:35:03 on branch trunk — OFString: Add -[substring{From,To}Index:] (user: js, size: 65474) [annotate] [blame] [check-ins using]
To Artifact [4df757c93c]:
- File
src/OFString.m
— part of check-in
[3d8286feee]
at
2020-11-04 23:18:25
on branch trunk
— Remove of_free()
While it makes sense to wrap malloc and calloc to replace the error
checking with exceptions, it does not make sense to wrap free. (user: js, size: 65456) [annotate] [blame] [check-ins using]
︙ | |||
838 839 840 841 842 843 844 | 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 | - + - + | { id ret; @try { ret = [self initWithUTF8String: UTF8String]; } @finally { if (freeWhenDone) |
︙ | |||
1033 1034 1035 1036 1037 1038 1039 | 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 | - + | @try { file = [[OFFile alloc] initWithPath: path mode: @"r"]; [file readIntoBuffer: tmp exactLength: (size_t)fileSize]; } @catch (id e) { |
︙ | |||
1055 1056 1057 1058 1059 1060 1061 | 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 | - + | freeWhenDone: true]; else { @try { self = [self initWithCString: tmp encoding: encoding length: (size_t)fileSize]; } @finally { |
︙ | |||
1883 1884 1885 1886 1887 1888 1889 | 1883 1884 1885 1886 1887 1888 1889 1890 1891 1892 1893 1894 1895 1896 1897 | - + | objc_autoreleasePoolPop(pool); return of_range(range.location + i, searchLength); } } } } @finally { |
︙ | |||
1945 1946 1947 1948 1949 1950 1951 | 1945 1946 1947 1948 1949 1950 1951 1952 1953 1954 1955 1956 1957 1958 1959 | - + | for (size_t i = 0; i < range.length; i++) if (characterIsMember(characterSet, @selector(characterIsMember:), characters[i])) return range.location + i; } } @finally { |
︙ |