Always the first one. Your first example has a time complexity of O(1) since you are directly fetching a value from a table.
Your second example has a time complexity of O(n), where ‘n’ refers to the number of items you have inside your table. Meaning if your table has 10 items, you may need to iterate over every single one of those 10 items to find the Character, whereas in the first example you’re getting it straight away through accessing the value in the table with the provided key.