{"action":"opened","issue":{"url":"https://api.github.com/repos/WebAssembly/binaryen/issues/489","repository_url":"https://api.github.com/repos/WebAssembly/binaryen","labels_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/489/labels{/name}","comments_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/489/comments","events_url":"https://api.github.com/repos/WebAssembly/binaryen/issues/489/events","html_url":"https://github.com/WebAssembly/binaryen/issues/489","id":154602646,"number":489,"title":"Use Index in std::maps in wasm-binary.h?","user":{"login":"BSalita","id":1225749,"avatar_url":"https://avatars.githubusercontent.com/u/1225749?v=3","gravatar_id":"","url":"https://api.github.com/users/BSalita","html_url":"https://github.com/BSalita","followers_url":"https://api.github.com/users/BSalita/followers","following_url":"https://api.github.com/users/BSalita/following{/other_user}","gists_url":"https://api.github.com/users/BSalita/gists{/gist_id}","starred_url":"https://api.github.com/users/BSalita/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/BSalita/subscriptions","organizations_url":"https://api.github.com/users/BSalita/orgs","repos_url":"https://api.github.com/users/BSalita/repos","events_url":"https://api.github.com/users/BSalita/events{/privacy}","received_events_url":"https://api.github.com/users/BSalita/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2016-05-12T23:21:04Z","updated_at":"2016-05-12T23:21:04Z","closed_at":null,"body":"While working on harmonizing the type of lengths, I see that my changes are suggesting that all the `std::map` in wasm-binary.h may need different (improved) types. Am I correct that these maps actually contain indexes and therefore should use type of Index instead of uint32_t or size_t? If so, I propose the following declarations.\r\n\r\n1. std::map<Index, Index> mappedLocals;\r\n\r\n2. std::map<WasmType, Index> numLocalsByType;\r\n\r\n3. std::map<WasmType, Index> currLocalsByType;\r\n\r\n4. std::map<Name, Index> mappedImports;\r\n\r\n5. std::map<Name, Index> mappedFunctions;\r\n\r\n6. std::map<Index, std::vector<Call*>> functionCalls;\r\n\r\n7. std::map<Export*, Index> exportIndexes;\r\n"}}