Skip to content

Commit 660ca2f

Browse files
jvitkauskasroji
authored andcommitted
Fix logic typos
1 parent 764439d commit 660ca2f

4 files changed

Lines changed: 8 additions & 6 deletions

File tree

src/Npgsql/FrontendMessages/ExecuteMessage.cs

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,8 @@ public override string ToString()
6666
sb.Append("[Execute");
6767
if (Portal != "" && MaxRows != 0)
6868
{
69-
if (Portal != "")
70-
sb.Append("Portal=").Append(Portal);
71-
if (MaxRows != 0)
72-
sb.Append("MaxRows=").Append(MaxRows);
69+
sb.Append("Portal=").Append(Portal);
70+
sb.Append("MaxRows=").Append(MaxRows);
7371
}
7472
sb.Append(']');
7573
return sb.ToString();

src/Npgsql/NpgsqlTypes/NpgsqlDateTime.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -329,7 +329,7 @@ public int CompareTo(NpgsqlDateTime other)
329329
return 1;
330330
default:
331331
var cmp = _date.CompareTo(other._date);
332-
return cmp == 0 ? _time.CompareTo(_time) : cmp;
332+
return cmp == 0 ? _time.CompareTo(other._time) : cmp;
333333
}
334334
}
335335
}

src/Npgsql/PreparedStatement.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,11 @@ internal void SetParamTypes(List<NpgsqlParameter> parameters)
8484
{
8585
Debug.Assert(HandlerParamTypes == null);
8686
if (parameters.Count == 0)
87+
{
8788
HandlerParamTypes = EmptyParamTypes;
89+
return;
90+
}
91+
8892
HandlerParamTypes = new Type[parameters.Count];
8993
for (var i = 0; i < parameters.Count; i++)
9094
{

src/Npgsql/SqlQueryParser.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -273,7 +273,7 @@ internal void ParseRawQuery(string sql, bool standardConformantStrings, NpgsqlPa
273273
goto NoneContinue;
274274

275275
}
276-
if (ch != ' ' && ch != '\t' && ch != '\n' & ch != '\r' && ch != '\f') {
276+
if (ch != ' ' && ch != '\t' && ch != '\n' && ch != '\r' && ch != '\f') {
277277
lastChar = '\0';
278278
goto NoneContinue;
279279
}

0 commit comments

Comments
 (0)