Created
March 29, 2012 09:42
-
-
Save arika/2235451 to your computer and use it in GitHub Desktop.
improve process time of octopress/jekyll
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # based lib/jekyll/site.rb of jekyll 0.11.0 | |
| module Jekyll | |
| class Site | |
| class PostList < Array | |
| def index(obj) | |
| unless @hash | |
| @hash = {} | |
| each_with_index do |post, idx| | |
| @hash[post.object_id] = idx | |
| end | |
| freeze | |
| end | |
| @hash[obj.object_id] | |
| end | |
| end | |
| alias orig_reset reset | |
| def reset | |
| orig_reset | |
| self.posts = PostList.new | |
| end | |
| end | |
| end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment