Quite probably, especially with bass, is that what you don't play is as important as what you do play.
Let me explain. It's very easy to make extraneous noises playing bass - other strings vibrating in sympathy, taking a finger off a just played fret, catching a string with the other hand/fingers.
With this in mind, most good players will mute everything they can except the note being played. They'll do this with whatever they can - it could be the plucking hand/fingers, or the fretting fingers. By sliding your finger across, which seems like a tidy move, you're letting one string go to favour the other. That can cause noise, as the string you moved from is now open. You could make sure the string just left is still muted by however much finger you can leave there.
The better way is to control each string with a separate finger. That way, the played string gets pressed onto the fingerboard, while the unplayed one gets muted, by keeping the same finger used for fretting touching that string. On the same fret isn't a problem.
That way, you will 'rock' your two fingers back and forth, alternately pressing and muting. Using two fingers from your plucking hand will mean you'll work up a good pace, and it'll all sound nice and clean. All you are left with is trying to keep a steady pace at whatever tempo is needed.
When the above is sorted, you might like to consider what happens with the open D and G strings. While you play your G note on the bottom string, that top G might start to vibrate - it may well do the same when you play the C note too. So the objective here is to mute those opens as well. Maybe with a couple of spare fingers from right hand, maybe a couple of spare fingers from left. Yours to experiment. Good luck, and clean playing!