mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-17 03:40:18 +00:00
Merge pull request #425 from onhachoe/master
change ASMutableAttributedStringBuilderTests so that it is safe against ...
This commit is contained in:
commit
203748d069
@ -29,7 +29,8 @@
|
|||||||
- (NSRange)_randomizedRangeForStringBuilder:(ASMutableAttributedStringBuilder *)builder
|
- (NSRange)_randomizedRangeForStringBuilder:(ASMutableAttributedStringBuilder *)builder
|
||||||
{
|
{
|
||||||
NSUInteger loc = arc4random() % (builder.length - 1);
|
NSUInteger loc = arc4random() % (builder.length - 1);
|
||||||
NSUInteger len = MAX(arc4random() % (builder.length - loc), 1);
|
NSUInteger len = arc4random() % (builder.length - loc);
|
||||||
|
len = ((len > 0) ? len : 1);
|
||||||
return NSMakeRange(loc, len);
|
return NSMakeRange(loc, len);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user