mirror of
https://gitlab.freedesktop.org/uchardet/uchardet.git
synced 2025-12-06 16:56:40 +08:00
src: fix non-guarded 'if' warning.
Not sure if this is useful to have the 'if (mDetectedCharset)' outside
the if block, but it won't hurt for sure in this specific case, so I
leave the current code logics as is.
The exact warning was:
nsUniversalDetector.cpp: In member function ‘virtual nsresult nsUniversalDetector::HandleData(const char*, PRUint32)’:
nsUniversalDetector.cpp:115:5: warning: this ‘if’ clause does not guard... [-Wmisleading-indentation]
if (aLen > 2)
^~
nsUniversalDetector.cpp:157:7: note: ...this statement, but the latter is misleadingly indented as if it is guarded by the ‘if’
if (mDetectedCharset)
^~
This commit is contained in:
parent
26024e5c82
commit
183092d048
@ -113,6 +113,7 @@ nsresult nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen)
|
|||||||
{
|
{
|
||||||
mStart = PR_FALSE;
|
mStart = PR_FALSE;
|
||||||
if (aLen > 2)
|
if (aLen > 2)
|
||||||
|
{
|
||||||
switch (aBuf[0])
|
switch (aBuf[0])
|
||||||
{
|
{
|
||||||
case '\xEF':
|
case '\xEF':
|
||||||
@ -153,12 +154,13 @@ nsresult nsUniversalDetector::HandleData(const char* aBuf, PRUint32 aLen)
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (mDetectedCharset)
|
if (mDetectedCharset)
|
||||||
{
|
{
|
||||||
mDone = PR_TRUE;
|
mDone = PR_TRUE;
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
PRUint32 i;
|
PRUint32 i;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user