I'm relatively new to ruby so bear with me. I have an array called `a`. `a` is an array of strings that can sometimes be unique and sometimes not. So `a` can look like this:

```
#an example of a unique instance of a
a = ["a", "b", "c", "d"]

#an example of a non-unique instance of a
a = ["a", "a", "b", "a"]

```

I'm doing `a.uniq!.map!`. This works only when `a` is not unique because if an array is already unique calling `uniq` will just return an empty array and `.map!` errors out for being called on a nil object. What is the most ruby way of checking if the array is unique and if it is call `uniq` on it and if it's not unique I don't call `uniq` on it. 

I realize I can do this in a verbose way pretty easily but I feel like there is some ruby syntax that will make it clean and simple.