Modify

Ticket #153 (new enhancement)

Opened 4 years ago

Last modified 4 years ago

remove reduntant code in Reader

Reported by: py4fun@… Owned by: xi
Priority: low Component: pyyaml
Severity: minor Keywords:
Cc:

Description

Remove reduntant check:

Index: lib/yaml/reader.py =================================================================== --- lib/yaml/reader.py (revision 369) +++ lib/yaml/reader.py (working copy) @@ -147,12 +147,8 @@

length -= 1

def get_mark(self):

  • if self.stream is None:
  • return Mark(self.name, self.index, self.line, self.column,
  • self.buffer, self.pointer)
  • else:
  • return Mark(self.name, self.index, self.line, self.column,
  • None, None)

+ return Mark(self.name, self.index, self.line, self.column, + self.buffer, self.pointer)

def determine_encoding(self):

while not self.eof and len(self.raw_buffer) < 2:

Attachments

Change History

comment:1 Changed 4 years ago by anonymous

Sorry, forgot to keep the format:

Index: lib/yaml/reader.py
===================================================================
--- lib/yaml/reader.py	(revision 369)
+++ lib/yaml/reader.py	(working copy)
@@ -147,12 +147,8 @@
             length -= 1
 
     def get_mark(self):
-        if self.stream is None:
-            return Mark(self.name, self.index, self.line, self.column,
-                    self.buffer, self.pointer)
-        else:
-            return Mark(self.name, self.index, self.line, self.column,
-                    None, None)
+        return Mark(self.name, self.index, self.line, self.column,
+            self.buffer, self.pointer)
 
     def determine_encoding(self):
         while not self.eof and len(self.raw_buffer) < 2:
View

Add a comment

Modify Ticket

Change Properties
<Author field>
Action
as new
as The resolution will be set. Next status will be 'closed'
to The owner will be changed from xi. Next status will be 'new'
The owner will be changed from xi to anonymous. Next status will be 'assigned'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.