In 1840 , New York -- which , like most states , did not require pre-Election Day registration -- adopted a registration law that applied only to New York City , aimed at the growing Irish Catholic population .