Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactor: improve efficiency in
isSublist
(#36)
The compiler is not yet smart enough to figure out that `Set.fromList sup` does not change in the loop and lift it out. The list will be converted to a set repeatedly in each iteration, yielding quadratic complexity overall. In general, it's safest to assume a "literal" translation: things get executed exactly at the point they occur. Applying constructors, creating pairs and other data types, partially applying functions, etc., always allocates memory for the data type / function closure at the point where this occurs in the program. Some things might be optimized away, but not much.
- Loading branch information