Improve RecentFavorite static function

Signed-off-by: Edward Cheng <c4150221@gmail.com>