I have a Map of a List. I am managing the data in the map and the list. I have it working for now, but wanted to find out if there is a better way to do this.
mapping (bytes32 => Receipts) receiptsByPersonMap; Receipts dummyReceiptsList; Receipts newReceipt = new Receipts(_person, _cost); dummyReceiptsList = receiptsByPersonMap[_person]; dummyReceiptsList.push(newReceipt); receiptsByPersonMap[_person] = dummyReceiptsList;
This works for now. it seems that the last line is irrelevant - if receiptsList is pointing to the same storage space. Any suggestion of a better way to do this.