Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitf9567fd

Browse files
committed
fixed a logic error: abs shouldn't be used for (unsigned - unsigned)
1 parent701f604 commitf9567fd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

‎ClangFormat/TRVSFormatter.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,8 @@ - (void)formatDocument:(IDESourceCodeDocument *)document {
9595
[selfformatRanges:@[ [NSValuevalueWithRange:NSMakeRange(0, length)] ]
9696
inDocument:document];
9797

98-
NSUInteger diff =labs(length - [[documenttextStorage]length]);
98+
NSUInteger textStorageLength = [[documenttextStorage]length];
99+
NSUInteger diff =MAX(length, textStorageLength) -MIN(length, textStorageLength);
99100

100101
BOOL documentIsLongerAfterFormatting =
101102
length > [[documenttextStorage]length];

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp