readabilite: improve word count
This commit is contained in:
		@@ -19,12 +19,15 @@ def count_words(string):
 | 
				
			|||||||
    And so in about every language (sorry chinese).
 | 
					    And so in about every language (sorry chinese).
 | 
				
			||||||
    Basically skips spaces in the count. """
 | 
					    Basically skips spaces in the count. """
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    if string is None:
 | 
				
			||||||
 | 
					        return 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    i = 0
 | 
					    i = 0
 | 
				
			||||||
    count = 0
 | 
					    count = 0
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    try:
 | 
					    try:
 | 
				
			||||||
        while True:
 | 
					        while True:
 | 
				
			||||||
            if string[i] not in '\n\t ':
 | 
					            if string[i] not in "\r\n\t ":
 | 
				
			||||||
                count += 1
 | 
					                count += 1
 | 
				
			||||||
                i += 6
 | 
					                i += 6
 | 
				
			||||||
            else:
 | 
					            else:
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user