Skip to content

Commit

Permalink
false\.Equals\((\w+?.\w+?\(?\))\) -> $1 is false.
Browse files Browse the repository at this point in the history
  • Loading branch information
juliusfriedman committed Nov 21, 2023
1 parent 0664cc9 commit 06e63e1
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 18 deletions.
2 changes: 1 addition & 1 deletion Common/Extensions/SocketExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -810,7 +810,7 @@ public static bool IsTcpNotUrgent(System.Net.Sockets.Socket socket)
public static bool IsTcpStandardUrgency(System.Net.Sockets.Socket socket, bool checkNotUrgent = true)
{
//if checkNotUrgent and NotUrgent is set then IsNotUrgent will return false
if (checkNotUrgent && false.Equals(IsTcpNotUrgent(socket))) return false;
if (checkNotUrgent && IsTcpNotUrgent(socket) is false) return false;

int len = Common.Binary.BytesPerInteger;

Expand Down
2 changes: 1 addition & 1 deletion Common/Extensions/StringExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public static System.Collections.Generic.IEnumerable<string> SplitLazy(this stri
for (int i = 0; i < value.Length; ++i)
{
char c = value[i];
if (false.Equals(predicate(c)))
if (predicate(c) is false)
{
sb.Append(c);
}
Expand Down
10 changes: 5 additions & 5 deletions Concepts/Classes/Number.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2663,7 +2663,7 @@ public System.Numerics.Complex ToComplex(int? realIndex = null, int? imaginaryIn
public static Number operator +(Number a, Number b)
{
if (IsNull(a))
if (false.Equals(IsNull(b))) return b;
if (IsNull(b) is false) return b;
else return (Number)Bitable.SingleZero;
else return a.MathProvider.Addition(ref a, ref b);
}
Expand All @@ -2672,7 +2672,7 @@ public System.Numerics.Complex ToComplex(int? realIndex = null, int? imaginaryIn
public static Number operator -(Number a, Number b)
{
if (IsNull(a))
if (false.Equals(IsNull(b))) return b;
if (IsNull(b) is false) return b;
else return (Number)Bitable.SingleZero;
else return a.MathProvider.Subtraction(ref a, ref b);
}
Expand All @@ -2681,7 +2681,7 @@ public System.Numerics.Complex ToComplex(int? realIndex = null, int? imaginaryIn
public static Number operator /(Number a, Number b)
{
if (IsNull(a))
if (false.Equals(IsNull(b))) return b;
if (IsNull(b) is false) return b;
else return (Number)Bitable.SingleZero;
else return a.MathProvider.Division(ref a, ref b);
}
Expand All @@ -2690,7 +2690,7 @@ public System.Numerics.Complex ToComplex(int? realIndex = null, int? imaginaryIn
public static Number operator %(Number a, Number b)
{
if (IsNull(a))
if (false.Equals(IsNull(b))) return b;
if (IsNull(b) is false) return b;
else return (Number)Bitable.SingleZero;
else return a.MathProvider.Modulus(ref a, ref b);
}
Expand All @@ -2699,7 +2699,7 @@ public System.Numerics.Complex ToComplex(int? realIndex = null, int? imaginaryIn
public static Number operator *(Number a, Number b)
{
if (IsNull(a))
if (false.Equals(IsNull(b))) return b;
if (IsNull(b) is false) return b;
else return (Number)Bitable.SingleZero;
else return a.MathProvider.Multiplication(ref a, ref b);
}
Expand Down
6 changes: 3 additions & 3 deletions Http/HttpMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,7 @@ m_Buffer is not null && // Be parsing the StatusLine
//Check for Trailer header (maybe TE)
string trailerHeader = GetHeader(HttpHeaders.Trailer);

if (false.Equals(string.IsNullOrWhiteSpace(trailerHeader)) && false.Equals(ContainsHeader(trailerHeader))) return false;
if (string.IsNullOrWhiteSpace(trailerHeader) is false && ContainsHeader(trailerHeader) is false) return false;

//Todo, Must Have Allow header if StatusCode == 405.. technically not valid otherwise but can be complete if not present.

Expand All @@ -848,7 +848,7 @@ m_Buffer is not null && // Be parsing the StatusLine
bool hasNullBody = string.IsNullOrWhiteSpace(m_Body);

//Determine if the count of the octets in the body is greater than or equal to the supposed amount
return false.Equals(ParseContentLength(hasNullBody)) && hasNullBody && m_ContentLength > 0 ? m_HeadersParsed : ContentEncoding.GetByteCount(m_Body) >= m_ContentLength;
return ParseContentLength(hasNullBody) is false && hasNullBody && m_ContentLength > 0 ? m_HeadersParsed : ContentEncoding.GetByteCount(m_Body) >= m_ContentLength;
}

//The message is complete
Expand Down Expand Up @@ -1618,7 +1618,7 @@ internal protected virtual bool ParseBody(out int remaining, bool force = false)
if (force is false && MessageType.Equals(HttpMessageType.Invalid)) return true; //or the message is complete then return true

//If no headers could be parsed then don't parse the body
if (false.Equals(ParseHeaders())) return false;
if (ParseHeaders() is false) return false;

//Transfer-Encoding chunked will be present if headers are parsed and the message is chunked.

Expand Down
6 changes: 3 additions & 3 deletions Rtp/RtpClient.Methods.cs
Original file line number Diff line number Diff line change
Expand Up @@ -430,7 +430,7 @@ public partial class RtpClient : Media.Common.ILoggingReference
{
c = TransportContexts[i];

if (false.Equals(Media.Common.IDisposedExtensions.IsNullOrDisposed(c)) &&
if (Common.IDisposedExtensions.IsNullOrDisposed(c) is false &&
System.MemoryExtensions.IndexOfAny(channels, c.DataChannel, c.ControlChannel) >= 0) break;

c = null;
Expand Down Expand Up @@ -568,7 +568,7 @@ context.IsRtcpEnabled is false ||
foreach (Rtcp.RtcpPacket packet in packets)
{
//If the data is not contigious
if (false.Equals(packet.IsContiguous()))
if (packet.IsContiguous() is false)
{
//Just send all packets in their own array by projecting the data (causes an allocation)
sent += SendData(System.Linq.Enumerable.ToArray(RFC3550.ToCompoundBytes(packets)),
Expand Down Expand Up @@ -1038,7 +1038,7 @@ public int SendRtpPacket(RtpPacket packet, TransportContext transportContext, ou
//Check if the packet cannot be sent in place
if (ssrc.HasValue && false.Equals(ssrc.Equals(packet.SynchronizationSourceIdentifier))
||
false.Equals(packet.IsContiguous()))
packet.IsContiguous() is false)
{

//If the transportContext is changed to automatically update the timestamp by frequency then use transportContext.RtpTimestamp
Expand Down
2 changes: 1 addition & 1 deletion Rtp/RtpPacket.cs
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ public int PaddingOctets

get
{
if (IsDisposed || false.Equals(Header.Padding)) return 0;
if (IsDisposed || Header.Padding is false) return 0;

return Media.RFC3550.ReadPadding(Payload.Array, Payload.Offset + Payload.Count - 1, 1);
}
Expand Down
8 changes: 4 additions & 4 deletions Rtsp/RtspMessage.cs
Original file line number Diff line number Diff line change
Expand Up @@ -462,7 +462,7 @@ m_Buffer is not null && // Be parsing the StatusLine
}

//Messages without complete header sections are not complete
if (false.Equals(ParseHeaders()) /*&& m_CSeq == -1*/) return false;
if (ParseHeaders() is false /*&& m_CSeq == -1*/) return false;

//Don't check for any required values, only that the end of headers was seen.
//if (MessageType == HttpMessageType.Request && CSeq == -1 || //All requests must contain a sequence number
Expand Down Expand Up @@ -784,17 +784,17 @@ protected internal override bool ParseBody(out int remaining, bool force = false
// }

// //If the status line was not parsed return the number of bytes written, reparse if there are no headers parsed yet.
// if (false.Equals(ParseStatusLine(RtspMessageType == RtspMessageType.Invalid) || false.Equals(m_StatusLineParsed))) return received;
// if (false.Equals(ParseStatusLine(RtspMessageType == RtspMessageType.Invalid) || m_StatusLineParsed) is false) return received;
// else if (m_Buffer is not null && m_Buffer.CanSeek) m_Buffer.Seek(m_HeaderOffset, System.IO.SeekOrigin.Begin); // Seek past the status line.

// //Determine if there can be and is a body already
// bool hasNullBody = CanHaveBody && string.IsNullOrEmpty(m_Body);

// //Force the re-parsing of headers unless the body has started parsing.
// if (false.Equals(ParseHeaders(hasNullBody))) return received;
// if (ParseHeaders(hasNullBody) is false) return received;

// //Reparse any content-length if it was not already parsed or was a 0 value and the body is still null
// if (m_ContentLength <= 0 && false.Equals(ParseContentLength(hasNullBody))) return received;
// if (m_ContentLength <= 0 && ParseContentLength(hasNullBody) is false) return received;

// //Http closes the connection when there is no content-length...

Expand Down

0 comments on commit 06e63e1

Please sign in to comment.