@@ -199,7 +199,7 @@ public bool EndOfData
199199 {
200200 return _endOfData ;
201201 }
202- if ( ( _reader == null ) | ( _buffer == null ) )
202+ if ( ( _reader == null ) || ( _buffer == null ) )
203203 {
204204 _endOfData = true ;
205205 return true ;
@@ -217,7 +217,7 @@ public long LineNumber
217217 {
218218 get
219219 {
220- if ( _lineNumber != - 1 && ( ( _reader . Peek ( ) == - 1 ) & ( _position == _charsRead ) ) )
220+ if ( _lineNumber != - 1 && ( ( _reader . Peek ( ) == - 1 ) && ( _position == _charsRead ) ) )
221221 {
222222 // Side effect of a property. Not great. Just leaving it in for now.
223223 CloseReader ( ) ;
@@ -405,7 +405,7 @@ public void SetFieldWidths(params int[] fieldWidths)
405405
406406 public string ReadLine ( )
407407 {
408- if ( ( _reader == null ) | ( _buffer == null ) )
408+ if ( ( _reader == null ) || ( _buffer == null ) )
409409 {
410410 return null ;
411411 }
@@ -424,7 +424,7 @@ public string ReadLine()
424424
425425 public string [ ] ReadFields ( )
426426 {
427- if ( ( _reader == null ) | ( _buffer == null ) )
427+ if ( ( _reader == null ) || ( _buffer == null ) )
428428 {
429429 return null ;
430430 }
@@ -453,7 +453,7 @@ public string PeekChars(int numberOfChars)
453453 throw new ArgumentException ( string . Format ( Strings . PositiveNumberOfCharacters , nameof ( numberOfChars ) ) ) ;
454454 }
455455
456- if ( ( _reader == null ) | ( _buffer == null ) )
456+ if ( ( _reader == null ) || ( _buffer == null ) )
457457 {
458458 return null ;
459459 }
@@ -482,7 +482,7 @@ public string PeekChars(int numberOfChars)
482482
483483 public string ReadToEnd ( )
484484 {
485- if ( ( _reader == null ) | ( _buffer == null ) )
485+ if ( ( _reader == null ) || ( _buffer == null ) )
486486 {
487487 return null ;
488488 }
@@ -642,7 +642,7 @@ private int SlideCursorToStartOfBuffer()
642642 {
643643 Debug . Assert ( _buffer != null , "There's no buffer" ) ;
644644 Debug . Assert ( _reader != null , "There's no StreamReader" ) ;
645- Debug . Assert ( ( _position >= 0 ) & ( _position <= _buffer . Length ) , "The cursor is out of range" ) ;
645+ Debug . Assert ( ( _position >= 0 ) && ( _position <= _buffer . Length ) , "The cursor is out of range" ) ;
646646 if ( _position > 0 )
647647 {
648648 int bufferLength = _buffer . Length ;
@@ -710,7 +710,7 @@ private string PeekNextDataLine()
710710 private string ReadNextLine ( ref int cursor , ChangeBufferFunction changeBuffer )
711711 {
712712 Debug . Assert ( _buffer != null , "There's no buffer" ) ;
713- Debug . Assert ( ( cursor >= 0 ) & ( cursor <= _charsRead ) , "The cursor is out of range" ) ;
713+ Debug . Assert ( ( cursor >= 0 ) && ( cursor <= _charsRead ) , "The cursor is out of range" ) ;
714714 if ( cursor == _charsRead && changeBuffer ( ) == 0 )
715715 {
716716 return null ;
@@ -722,7 +722,7 @@ private string ReadNextLine(ref int cursor, ChangeBufferFunction changeBuffer)
722722 for ( int i = cursor ; i <= _charsRead - 1 ; i ++ )
723723 {
724724 char Character = _buffer [ i ] ;
725- if ( ! ( Character . Equals ( '\r ' ) | Character . Equals ( '\n ' ) ) )
725+ if ( ! ( Character . Equals ( '\r ' ) || Character . Equals ( '\n ' ) ) )
726726 {
727727 continue ;
728728 }
@@ -912,16 +912,16 @@ private int GetEndOfLineIndex(string line)
912912 Debug . Assert ( length > 0 , "A blank line shouldn't be parsed" ) ;
913913 if ( length == 1 )
914914 {
915- Debug . Assert ( ! line [ 0 ] . Equals ( '\r ' ) & ! line [ 0 ] . Equals ( '\n ' ) , "A blank line shouldn't be parsed" ) ;
915+ Debug . Assert ( ! line [ 0 ] . Equals ( '\r ' ) && ! line [ 0 ] . Equals ( '\n ' ) , "A blank line shouldn't be parsed" ) ;
916916 return length ;
917917 }
918918 checked
919919 {
920- if ( line [ length - 2 ] . Equals ( '\r ' ) | line [ length - 2 ] . Equals ( '\n ' ) )
920+ if ( line [ length - 2 ] . Equals ( '\r ' ) || line [ length - 2 ] . Equals ( '\n ' ) )
921921 {
922922 return length - 2 ;
923923 }
924- if ( line [ length - 1 ] . Equals ( '\r ' ) | line [ length - 1 ] . Equals ( '\n ' ) )
924+ if ( line [ length - 1 ] . Equals ( '\r ' ) || line [ length - 1 ] . Equals ( '\n ' ) )
925925 {
926926 return length - 1 ;
927927 }
@@ -1020,7 +1020,7 @@ private void ValidateAndEscapeDelimiters()
10201020
10211021 private void ValidateReadyToRead ( )
10221022 {
1023- if ( ! ( _needPropertyCheck | ArrayHasChanged ( ) ) )
1023+ if ( ! ( _needPropertyCheck || ArrayHasChanged ( ) ) )
10241024 {
10251025 return ;
10261026 }
@@ -1041,7 +1041,7 @@ private void ValidateReadyToRead()
10411041 string [ ] commentTokens = _commentTokens ;
10421042 foreach ( string token in commentTokens )
10431043 {
1044- if ( token != string . Empty && ( _hasFieldsEnclosedInQuotes & ( _textFieldType == FieldType . Delimited ) ) && string . Compare ( token . Trim ( ) , "\" " , StringComparison . Ordinal ) == 0 )
1044+ if ( token != string . Empty && ( _hasFieldsEnclosedInQuotes && ( _textFieldType == FieldType . Delimited ) ) && string . Compare ( token . Trim ( ) , "\" " , StringComparison . Ordinal ) == 0 )
10451045 {
10461046 throw new Exception ( Strings . IllegalQuoteDelimiter ) ;
10471047 }
@@ -1077,7 +1077,7 @@ private bool ArrayHasChanged()
10771077 {
10781078 case FieldType . Delimited :
10791079 {
1080- Debug . Assert ( ( ( _delimitersCopy == null ) & ( _delimiters == null ) ) | ( ( _delimitersCopy != null ) & ( _delimiters != null ) ) , "Delimiters and copy are not both Nothing or both not Nothing" ) ;
1080+ Debug . Assert ( ( ( _delimitersCopy == null ) && ( _delimiters == null ) ) || ( ( _delimitersCopy != null ) & & ( _delimiters != null ) ) , "Delimiters and copy are not both Nothing or both not Nothing" ) ;
10811081 if ( _delimiters == null )
10821082 {
10831083 return false ;
@@ -1097,7 +1097,7 @@ private bool ArrayHasChanged()
10971097 }
10981098 case FieldType . FixedWidth :
10991099 {
1100- Debug . Assert ( ( ( _fieldWidthsCopy == null ) & ( _fieldWidths == null ) ) | ( ( _fieldWidthsCopy != null ) & ( _fieldWidths != null ) ) , "FieldWidths and copy are not both Nothing or both not Nothing" ) ;
1100+ Debug . Assert ( ( ( _fieldWidthsCopy == null ) && ( _fieldWidths == null ) ) || ( ( _fieldWidthsCopy != null ) & & ( _fieldWidths != null ) ) , "FieldWidths and copy are not both Nothing or both not Nothing" ) ;
11011101 if ( _fieldWidths == null )
11021102 {
11031103 return false ;
0 commit comments