joshy / striprtf

Stripping rtf to plain old text
http://striprtf.dev
BSD 3-Clause "New" or "Revised" License
94 stars 27 forks source link

Redundant lines of code, suggestion, and question #18

Closed jakewilliami closed 3 years ago

jakewilliami commented 3 years ago

Hi there!

Neat little package you have here. Thank you :-)

I was wondering, are lines 143 and 153 redundant? On that note, in this try block, could you not just do

if stack:
    ucskip, ignorable = stack.pop()
else:
    ucskip = 0
    ignorable = True

This might be more performant than a try block.

I was also wondering, would you mind if I ported this logic into another language?

All the best!

joshy commented 3 years ago

Hi,

thanks for the suggestions, make sense to me. About the if else, that could be just omitted because in both cases it is doing the same thing. Also here. I will make a new release with the suggested changes soon.

Please go ahead and port it to another language.

All the best!